Help with if and/or

Liz_I3

Well-known Member
Joined
Dec 30, 2002
Messages
647
Office Version
  1. 2016
Platform
  1. Windows
Hi I can't get this to work Column K is a formula =IF(OR(H10 ="",H10 = "NULL"),"",H10-F10) and formatted as 37:30:55 example row 10 column K result is 105:09:12
Column C is just text
I want to have the condition met if the hours in K are less than or equal to 104:00:00 AND C equals Red OR Yellow


=IF(AND(TEXT(K10,"hh:mm")<="104:00",OR(C10="Red",C10="Yellow")),"Met",Missed")

Thanks
L
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Maybe try this:
=IF(AND(K10<=(104/24),OR(C10="Red",C10="Yellow")),"Met",Missed")
 
Upvote 0
Thanks but I am still not always getting the correct result. I think it is the time part that is not working they Red ,Yellow I think is ok

column K is 105:07:42 and I entered =IF(AND(K6<=(106/24),OR(C6="Red",C6="Yellow")),"Met","Missed") it returned Missed it should have been Met

I also tried Column K is 16:42:51 =IF(AND(TEXT(K375,"[h]:mm")<="106:00:00",OR(C375="Red",C375="Yellow")),"Met","Missed") the result was Missed should have been Met

L
 
Upvote 0
Both work for me
+Fluff New.xlsm
CDEFGHIJKL
10Red105:09:12Met
11Red105:09:12Met
Shipment
Cell Formulas
RangeFormula
L10L10=IF(AND(K10<=(106/24),OR(C10="Red",C10="Yellow")),"Met","Missed")
L11L11=IF(AND(TEXT(K11,"[h]:mm")<="106:00",OR(C11="Red",C11="Yellow")),"Met","Missed")


Are you sure that your times, are real times & not text?
 
Upvote 0
Please give us an example that is not working, where you tell us the exact content of all the cells being called by the formulas (including the H and F columns that column K uses).
 
Upvote 0
CFHKK formated as 37:30:50
Red
14/07/2020 18:04​
15/07/2020 10:47​
0.6964307​
16:42:52​

F and H are formatted as dd/mm/yyyy h:mm I should get Met but it is returning Missed. For the examples above were K is 105:09:12 I got Met also but when I copied
the formula down then I got errors above is an example of one that was wrong.
Thanks for you help

L
 
Upvote 0
I recreated the example above, and it returns "Met" for me.
Are you sure that you do not have any extra spaces or invisible characters before or after the entry in column C?
A simple LEN function can confirm this, i.e.
if you have "Red" in cell C10, then this formula:
=LEN(C10)
should return 3. If it doesn't, you have other things in there.
 
Upvote 0
Thank you very much I think it is working. I will try a few more variations and post back

L
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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