A better formula?

Will85

Board Regular
Joined
Apr 26, 2012
Messages
240
Office Version
  1. 365
Platform
  1. Windows
There has to be a better, more concise formula than this.

I have revenue, and I want to compute favorability between a new period and an old period.

Higher revenue in the new period than the old period is good, less is bad. The % increase or decrease should follow suit.

If the old period had zero revenue and the new period had revenue, the % increase, while not mathematical, would be positive 100%

My data starts in A2. My Fav(Unfav) calc in C2 is A2-B2 (New-Old), my % formula in D2 is as follows: =+IF(OR(A2=0, B2=0), SIGN(C2), C2/ABS(B2))

Is there a better way to compute this?

NewOldFav(Unfav)%
1000100100%
0100-100-100%
-1000-100-100%
0-100100100%
1002080400%
20100-80-80%
-10020-120-600%
-20100-120-120%
-100-20-80-400%
100-20120600%

<tbody>
</tbody>
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
You could shorten it a little bit by writing it like this:
=IF(A2*B2,C2/ABS(B2),SIGN(C2))
 
Upvote 0
If that formula gives you the results you want, then why exactly do you want something better ?

You can simplify it slightly - this appears to give the same results
=IF(B2=0,SIGN(C2),C2/ABS(B2))
 
Upvote 0
thank you. thats an interesting use of the if function.

A2*B2 doesnt really create a question that can be answered by true or false, it just is what it is.

So is the rule behind a question in IF, that anything not zero is True, and anything zero is False?



You could shorten it a little bit by writing it like this:
=IF(A2*B2,C2/ABS(B2),SIGN(C2))
 
Upvote 0
Yes, if a number is in that spot, non-zero is TRUE and zero is FALSE.
 
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,765
Members
449,049
Latest member
greyangel23

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