SOLVED

Swap number's sign

%3CLINGO-SUB%20id%3D%22lingo-sub-2507000%22%20slang%3D%22en-US%22%3ESwap%20number's%20sign%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2507000%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20everyone%2C%3C%2FP%3E%3CP%3EDoes%20it%20exist%20a%20formula%20that%20replaces%20a%20number%20value's%20sign%20with%20the%20opposite%20sign%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEnglish%20is%20not%20my%20native%20language%2C%20and%20I%20do%20not%20have%20any%20experience%20with%20using%20English%20mathematical%20terms%2C%20so%20I%20am%20not%20sure%20whether%20or%20not%20I%20am%20expressing%20my%20question%20correctly.%20Simply%20what%20I%20am%20looking%20for%20is%20a%20formula%20that%20replaces%20as%20example%20%22-4%22%20with%20%224%22%20and%2032%20with%20%22-32%22.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2507000%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2507112%22%20slang%3D%22en-US%22%3ERe%3A%20Swap%20number's%20sign%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2507112%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1639%22%20target%3D%22_blank%22%3E%40Detlef%20Lewin%3C%2FA%3E%26nbsp%3BHow%20do%20I%20use%20that%3F%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3D-A1%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2511907%22%20slang%3D%22en-US%22%3ERe%3A%20Swap%20number's%20sign%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2511907%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1093123%22%20target%3D%22_blank%22%3E%40DannyDonkey%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20mean%20to%20change%20the%20sign%20in%20the%20same%20cell%2C%20that's%20VBA%20programming%2C%20not%20formula.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2512576%22%20slang%3D%22en-US%22%3ERe%3A%20Swap%20number's%20sign%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2512576%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20you%20mean%20to%20change%20the%20sign%2C%20but%20leave%20the%20values%20in%20the%20same%20cell%2C%20then%20you%20could%20input%20-1%20into%20an%20empty%20cell.%20Then%2C%20copy%20that%20cell%2C%20select%20the%20range%20you%20want%20to%20change%2C%20right%20click%2C%20select%20paste%20special%20(a%20dialog%20box%20should%20pop%20up)%2C%20and%20select%20%22multiply.%22%20Then%2C%20delete%20the%20cell%20with%20-1%20in%20it.%20Be%20sure%20to%20make%20a%20backup%20of%20your%20data%20before%20testing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEdit%3A%20I%20am%20assuming%20that%20the%20numbers%20you%20want%20to%20change%20are%20constant%20values%2C%20i.e.%20the%20cells%20just%20contain%20the%20numbers%20and%20not%20formulas%20that%20result%20in%20a%20number.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hey everyone,

Does it exist a formula that replaces a number value's sign with the opposite sign?

 

English is not my native language, and I do not have any experience with using English mathematical terms, so I am not sure whether or not I am expressing my question correctly. Simply what I am looking for is a formula that replaces as example "-4" with "4" and 32 with "-32".

5 Replies

@DannyDonkey 

=-A1

@Detlef Lewin How do I use that?

=-A1

 

@DannyDonkey 

If you mean to change the sign in the same cell, that's VBA programming, not formula.

If you mean to change the sign, but leave the values in the same cell, then you could input -1 into an empty cell. Then, copy that cell, select the range you want to change, right click, select paste special (a dialog box should pop up), and select "multiply." Then, delete the cell with -1 in it. Be sure to make a backup of your data before testing.

 

Edit: I am assuming that the numbers you want to change are constant values, i.e. the cells just contain the numbers and not formulas that result in a number.

best response confirmed by DannyDonkey (Occasional Contributor)
Solution

So far my only viable option is to multiply source cell by -1 like this:

=[source cell]*-1

This works well with my current calculator sheet, but for a future broader usage this wont work with algebraic expressions unless there is a way to make algebraic expression recognised by the application.