Double Negative % variances

molsviking

New Member
Joined
Jan 24, 2019
Messages
6
An interesting conundrum:

C9 has a figure which could be positive or negative.
H9 also has a figure which could be positive or negative.

If both figures in C9 & H9 are postive, then the variance in K9 with the following formula would return a positive variance: =IF(ISERROR((C9-H9)/H9),"N/A",(C9-H9)/H9)

However

If both figures in C9 & H9 are negative, then the variance in K9 would still show a positive variance. How can i amend the formula in K9 to show me a Negative figure instead of a positive one?

ie: C9 = -114,422
H9 = -22484
K9 = -408.9%
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
What about when 1 is positive and the other is negative? This will cure 1 problem but might cause another.

=IFERROR((C9-H9)/H9*SIGN(C9),"N/A")
 
Upvote 0
So out of the 4 possible combinations, which ones are incorrect with the edited formula?
 
Upvote 0
I have tweaked your formula and this works: =IF(ISERROR((C9-H9)/H9),"N/A",(C9-H9)/H9*SIGN(C9)), alternatively, this also works: IF(ISERROR((C9-H9)/ABS(H9)),"N/A",(C9-H9)/ABS(H9))

Both formulas give the same answer with positive/negative signs.

It also works for a positive & negative figure.

Thanks again for your help
 
Upvote 0
Your first one is just a longer version of my formula, you don't need to change IFERROR to IF(ISERROR unless you're using a version of excel that is ~13 years out of date.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top