Help with formula w multiple IFs

Laavista

Board Regular
Joined
Aug 27, 2009
Messages
79
I really need your help!

The following formula works:
=IF(F7="NR",R7-T7,IF(F7="OR",R7-T7,IF(F7="PR",R7-T7,IF(F7="SR",R7-T7,””))))

I need to add, though, that if there is nothing (no date) in cell R7, then this cell should be left blank. I have the following formula and it's not working:

=IF(R7<>””,(IF(F7="NR",R7-T7,IF(F7="OR",R7-T7,IF(F7="PR",R7-T7,IF(F7="SR",R7-T7,””))))))

This should read:
if cell R7 does not have a date, then leave this cell blank
if cell R7 DOES have a date then:
if F7 is equal to NR, then subtract date in R7 against date in T7
else
if F7 is equal to OR, then subtract date in R7 against date in T7
else
if F7 is equal to PR, then subtract date in R7 against date in T7
else
if F7 is equal to SR, then subtract date in R7 against date in T7
else
leave this cell blank (F7 is something other than NR, OR, PR, or SR)

Any help would GREATLY be appreciated!
 

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
=IF(AND(NOT(ISBLANK(R7)),OR(F7="NR",F7="OR",F7="PR",F7="SR")),R7-T7,"")

I am not checking if R7 is a date, just whether it is empty or not. Checking it for a date is more complicated and if it is either full or empty (as your question implies) this should suffice.
 
Upvote 0
Hey,

Try:

HTML:
=IF(R7<>"",IF(F7="NR",R7-T7,IF(F7="OR",R7-T7,IF(F7="PR",R7-T7,IF(F7="SR",R7-T7,””)))),"")
 
Upvote 0
Try:
Code:
=IF(NOT(ISBLANK(R7)),IF(OR(F7="NR",F7="OR",F7="PR",F7="SR"),R7-T7,""))
 
Upvote 0
Re: Help with formula w multiple IFs SOLVED

Wow-- all three solutions worked. I am so impressed. THANK YOU so much for taking the time to respond to my question. I spent a long time trying to get this formula to work (to no avail), and I urgently needed this info.

THANKS.
 
Upvote 0

Forum statistics

Threads
1,216,022
Messages
6,128,330
Members
449,442
Latest member
CaptBrownShoes

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