3 IF statements with condition (if not blank)

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
888
Office Version
  1. 365
Platform
  1. Windows
I have the below formula that I am missing something and cannot think of what:


Code:
=IF(N2=0,"",IF(S2="0",(N2-I2-(W2*(W2<>""),IF(S2>N2,(N2-S2-(W2*(W2<>""))))

If N2 is 0, leave blank
If S2 is 0: N2-I2 then subtract W2 (only if it is not blank)
If S2 is greater than N2: N2-S2 then subtract W2 (only if it is not blank)

Any help would be appreciated.

Thank you
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
This part "*(W2<>"")" does not work and is not needed, If W is blank then nothing will be minused!

=IF(N2=0,"",IF(S2="0",N2-I2-W2,IF(S2>N2,N2-S2-W2,""))))
 
Upvote 0
=IF(N2=0,"",IF(S2="0",(N2-I2)-(W2*(W2<>"")),IF(S2>N2,(N2-S2)-(W2*(W2<>"")))))

or

=IF(N2=0,"",IF(S2=0,(N2-I2)-W2,IF(S2>N2,(N2-S2)-W2)))
 
Upvote 0
I used this: =IF(N2=0,"",IF(S2="0",(N2-I2)-(W2*(W2<>"")),IF(S2>N2,(N2-S2)-(W2*(W2<>"")))))

Thanks guys! :)
 
Upvote 0
I am curious as to why you need to check if W2 is not blank! Like I said, if it's blank then it will minus zero!
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,071
Latest member
cdnMech

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