SOLVED

Swap number's sign

Copper 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 (Copper 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.

1 best response

Accepted Solutions
best response confirmed by DannyDonkey (Copper 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.

View solution in original post