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".
 
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"),""))))

that works like a charm for the two cells that formula needs to be in...

but the other two, which are "IF" formulas how would it be written for those cells?

this formula here:

=IF($D$4="Yes",$K$5,IF($D$4="No",$K$3,IF($D$4="PENDING","")))

how do i integrate the ST/OT option into this?

this is what im making but its not working:

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

i dont understand why you dont have to refer to "OT" anywhere in the formula
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Since the value can only be ST or OT once you know it is ST you know it is not OT so there is no reason to test it again. as if D3 does not = "ST" then you know it is OT.
maybe
Code:
=IF(D3="st",IF($D$4="Yes",$K$5,IF($D$4="No",$K$3,IF($D$4="PENDING",""))),IF($D$4="Yes",$K$6,IF($D$4="No",$K$4,IF($D$4="PENDING",""))))
 
Upvote 0
Since the value can only be ST or OT once you know it is ST you know it is not OT so there is no reason to test it again. as if D3 does not = "ST" then you know it is OT.
maybe
Code:
=IF(D3="st",IF($D$4="Yes",$K$5,IF($D$4="No",$K$3,IF($D$4="PENDING",""))),IF($D$4="Yes",$K$6,IF($D$4="No",$K$4,IF($D$4="PENDING",""))))

that works! Thanks everyone for the education.
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,535
Members
449,037
Latest member
tmmotairi

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