IF(OR formula

Marq

Well-known Member
Joined
Dec 13, 2004
Messages
914
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hello,

I am trying to write a formula that is an IF(OR

below is what I have:

=IF(OR(D5="Yes",D4="Yes",$K$5,IF(OR(D5="No",D4="No",$K$3,IF(OR(D5="PENDING",D4="PENDING",""))) which does not work

I also tried below, which gives me a #VALUE result

=OR(D5="Yes",D4="Yes",$K$5,OR(D5="No",D4="No",$K$3,OR(D5="PENDING",D4="PENDING","")))

I am trying to say this with the formula (formal written in cell D66):

If the drop down result in either D4 OR D5 equals YES, then populate this cell with the value that is in K5...or if the drop down result in either D4 or D5 is NO then populate this cell wit the value that is in K3....or if the drop down result in either D4 or D5 is PENDING then leave this cell blank.

basically if either cells D4 or D5 contain a yes then populate the cell with K5..............the only way the cell will be populated with K3 is if both D4 and D5 are "NO".
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
You haven't closed the OR functions. It should be:

=IF(OR(D5="Yes",D4="Yes"),$K$5,IF(OR(D5="No",D4="No"),$K$3,IF(OR(D5="PENDING",D4="PENDING"),"")))
 
Upvote 0
You haven't closed the OR functions. It should be:

=IF(OR(D5="Yes",D4="Yes"),$K$5,IF(OR(D5="No",D4="No"),$K$3,IF(OR(D5="PENDING",D4="PENDING"),"")))

it works!!..thanks!..i was missing those ")"'s, correct?
 
Upvote 0
Yes, that's correct.
 
Upvote 0
If you click on an augment in the screen tip it will select the augment in your formula. This can help you troubleshoot your problem as you can clearly see the ")" is not in the right place as it select everything instead of just the OR statement.
 

Attachments

  • tip.jpg
    tip.jpg
    45 KB · Views: 3
Upvote 0
Ok..I want to add one more thing to the formula...currently it is choosing straight time rates in K3 and K5....I now want to intergrate using the OT rates in K4 and K6

I made another drop down cell in D3. The only options are ST and OT.

If I chose ST in the drop down, then the formula you corrected for me wouldn't change the result....BUT if i pick OT then I need it to read K4 or K6...(K4 for all "No's" in D4 & D5...and K6 if either or both D4 & D5 have a "Yes".

basically i just want to change the rates based on the D3 choice of ST or OT....each ST and OT have two rates..so there are two different rates for ST and two different rates for OT.
 
Last edited:
Upvote 0
so, I'm saying if D3 is ST then the formula you corrected should calculate K3 or K5....if D3 is OT, then the formula you corrected for me should focus on K4 and K6
 
Upvote 0
here is pic of the drop down cells (D3 through D6)...and the rates (K3-K6)

I have default choices in D3-D6

These are the choices in drop downs:

D3: ST or OT
D4: Yes, No or PENDING
D5: Yes, No or PENDING
D6: Yes, No or PENDING
 

Attachments

  • rates.JPG
    rates.JPG
    27.3 KB · Views: 4
Upvote 0
here is what i have only as an "IF" formula...i get a "FALSE" result.

=IF(D3="OT",IF($D$4="Yes",$K$6,IF($D$4="No",$K$4,IF($D$4="PENDING",""))))=IF(D3="ST",IF($D$4="Yes",$K$5,IF($D$4="No",$K$3,IF($D$4="PENDING",""))))

I'll worry about the IF(OR later...for now im trying to get this one working
 
Upvote 0
Try
Code:
=IF(D3="st",IF(OR(D5="Yes",D4="Yes"),$K$5,IF(OR(D5="No",D4="No"),$K$3,IF(OR(D5="PENDING",D4="PENDING"),""))),IF(OR(D5="Yes",D4="Yes"),$K$6,IF(OR(D5="No",D4="No"),$K$4,IF(OR(D5="PENDING",D4="PENDING"),""))))
 
Upvote 0

Forum statistics

Threads
1,215,400
Messages
6,124,702
Members
449,180
Latest member
craigus51286

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