Using IF + AND/OR to pick formula type based on criteria set

sea_captain

New Member
Joined
Jan 10, 2017
Messages
11
I have some financial files that compare Actual vs Budget and a delta between the two for $ and % (4 columns) that is shared with my company
Sometimes the Delta $ and % have differing symbols (positive/negative). That seems to annoy some of the audience. (There are a lot of rows/columns and slides)
I am trying to place a formula in the Delta % that will calculate based on the whether the Delta $ is + or -. The goal is to have the deltas match $+/+% or $-/-%.

For example: The Delta $ formula is A-B=C / Delta % formula is C div/ B = D
(Col. A) Jan Act is $10 / (Col. B) Jan Bud is $8. (Col. C) Delta $ is +$2. (Col. D) Delta % is 25%
(Col. A) Jan Act is $10 / (Col. B) Jan Bud is -$8. (Col. C) Delta $ is +$18. (Col. D) Delta % is -225% (this is the scenario we are trying to avoid)

That i can think of, there are 4 potential scenarios (i'm only showing 2 examples above)
Since Column D (the goal) is based on Column C div by B, the 4 scenarios are: 1. C is +/D is -, 2. C is +/D is +, 3. C is -/D is +, 4. C is -/D is -.

I need help with the formula i'm trying to create (unsuccessfully - works but not in all scenarios), not even sure if it is right. It looks like this (below) (B=Budget / C=Delta $):
=IFERROR(IF(OR(B1>0,C1<0),C1/B1,OR(B1>0,C1>0,C1/B1,OR(B1<0,C1<0),-C1/B1,OR(B1<0,C1>0,-C1/D1))),0)

If you know an easier formula, i'm all ears.
No SQL/coding etc.
Thanks.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
What about =ABS(C1)/ABS(B1)?
 
Upvote 0
Sorry, I did not clearly understand what you are asking first time around.
perhaps this is better
= SIGN(C1)*(ABS(C1)/ABS(B1))
 
Upvote 0
Thanks. That didn't work either.
I need something that will make multiple scenarios/"opposite signs" match Delta $ = $X or -$X and Delta % = X% or -X%. Reds need to match Reds, Black needs to match Black.
As seen in the picture below, the formula on the right works for all scenarios, except the last one in yellow (+/-)
Picture1.png

so i'm trying to calculate a formula that say if A is Positive and B is Negative, then B div/ A (gives Neg Delta %) or if A is Negative and B is Negative (B is Neg so % should be neg but, it will be positive bc -/-=+) then -B div/ A etc. etc.

I'm just looking to compound(?) a formula to say IF this is X and that is Y, then use Z formula or...IF etc... I just don't know how to write it properly to work.
 
Upvote 0
Thanks for trying to it more clear, I still am not sure I grasp it. Can you add in your example a manual filled out column holding the correct answer?
How is S6 a positive Delta? -0.1-1.1 = -1.1?

Book1
ABCDEF
1ActPriorDelta (B-A)%Delta (A-B)%
210 15 5 33,3%-5 -33,3%
310 -15 -25 -166,7%25 166,7%
4-10 -15 -5 -33,3%5 33,3%
515 10 -5 -50,0%5 50,0%
6-10 15 25 166,7%-25 -166,7%
71.0 -0.1 -1 -1100,0%1 1100,0%
Sheet1
Cell Formulas
RangeFormula
C2:C7C2=B2-A2
D2:D7D2=SIGN(C2)*ABS(C2/B2)
E2:E7E2=A2-B2
F2:F7F2=SIGN(E2)*ABS(E2/B2)
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,799
Members
449,337
Latest member
BBV123

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