dmitrevski
New Member
- Joined
- Feb 28, 2020
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I need help with joining two sets of multiple nested IF formulas. I believe I need to use the OR condition but can't get this to work.
I'm essentially trying to say : IF D12 > D21 , do this... OR IF D12 < D21 do this... I can evaluate the each nested IF before and after the OR successfully.
It's when I try to combine the two pieces that I run into trouble.
Excel is not my first language. I'm a SQL developer, so getting the syntax correctly is proving difficult for me.
These are my two sets of nested IFs that work on their own. How do I add the OR condition in, to create one large formula?
=IF(D12>D21,0,
IF(AND(AND(D15>0,D12<=D21),D12>=D22),(D22-D12)*-0.5,
IF(AND(AND(D15<0,D12<=D21),D12>=D22),(D22-D12)*0.5,
IF(AND(AND(D15>0,D12<=D22),D12>=D23),(D22-D12)*-0.5,
IF(AND(AND(D15<0,D12<=D22),D12>=D23),(D22-D12)*0.5
)))))
=IF(D12<D21,0,
IF(AND(AND(D15>0,D12<=D21),D12>=D22),(D12-D22)*-0.5,
IF(AND(AND(D15<0,D12<=D21),D12>=D22),(D12-D22)*0.5,
IF(AND(AND(D15>0,D12<=D22),D12>=D23),(D12-D22)*-0.5,
IF(AND(AND(D15<0,D12<=D22),D12>=D23),(D12-D22)*0.5
)))))
Thank you!!!
I'm essentially trying to say : IF D12 > D21 , do this... OR IF D12 < D21 do this... I can evaluate the each nested IF before and after the OR successfully.
It's when I try to combine the two pieces that I run into trouble.
Excel is not my first language. I'm a SQL developer, so getting the syntax correctly is proving difficult for me.
These are my two sets of nested IFs that work on their own. How do I add the OR condition in, to create one large formula?
=IF(D12>D21,0,
IF(AND(AND(D15>0,D12<=D21),D12>=D22),(D22-D12)*-0.5,
IF(AND(AND(D15<0,D12<=D21),D12>=D22),(D22-D12)*0.5,
IF(AND(AND(D15>0,D12<=D22),D12>=D23),(D22-D12)*-0.5,
IF(AND(AND(D15<0,D12<=D22),D12>=D23),(D22-D12)*0.5
)))))
=IF(D12<D21,0,
IF(AND(AND(D15>0,D12<=D21),D12>=D22),(D12-D22)*-0.5,
IF(AND(AND(D15<0,D12<=D21),D12>=D22),(D12-D22)*0.5,
IF(AND(AND(D15>0,D12<=D22),D12>=D23),(D12-D22)*-0.5,
IF(AND(AND(D15<0,D12<=D22),D12>=D23),(D12-D22)*0.5
)))))
Thank you!!!