If and???

slinky192001

Board Regular
Joined
Mar 16, 2007
Messages
100
Hi

My spreadsheet is as shown below:

Column D
1 - Emergency
2 - High
3 - Normal

Column I
Date and Time

Column J
Date and Time

Column K
J2-I2 formatted as (h) MM:SS

I am trying to create a statement which says if column D is 1 - Emergency and column K is less than 48 hours then Yes in column L.

I have the following but its not working:

=IF((AND(D2="1 - Emergency", K2<"48:01")),"Y","N")

Any help would be fab.

Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You have some unneeded parens, and you need to turn the text string "48:01" into a number to do a less than comparison...

J2-I2 will not be 48 hours, it will be 2 (as in 2 days)..so just do <2
Try

=IF(AND(D2="1 - Emergency", K2<2),"Y","N")
 
Upvote 0
Thank you for all your replies.

I have the format in hours and minutes as i will be going on to say if 2 - high is less than 54 hours 30 mins then Y otherwise no.

Can you explain why i would put +0 in the K2<'48:01'? It works but i dont understand what it does.

Thanks
 
Upvote 0
"48:01" is a text value. Adding zero coerces it into a number representing a duration.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

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