When I broke the on /off switch on my vacuum I brought to an appliance repair shop. The cost to fix the switch was only 12 dollars. The repair was done in one day and I picked my vacuum up the following day. I have'nt had a problem with the repair for two years now.
Well it really depends on the brand of vacuum you are replacing. After you have tested the circuit to be sure there are no lose wires and that the switch is getting power the actual cost should not be much. Contact your brands website.
To find out how much it will cost to fix a switch on an upright vacuum you need to ask a repair man, I think it would be worth it if it was an expensive vacuum, but if it is a cheap one just replace it.