Why doesn't this work???

ppleasebob

Board Regular
Joined
Dec 23, 2002
Messages
145
=IF(B2>=I2,IF(B2<=M2,"Y"),"N")

B2 = 30/05/2010
I2 = 29/05/2010
M2 = 28/05/2011
(these are UK style dates)

I2 is the start date, M2 is the expiry date, B2 is a date that I want to confirm is between the start and the expiry dates.
Why should this formula give FALSE in the example above?, I would expect a Y in this instance..

Any suggestions gratefully received.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Because you need another "N" for the inside IF statment

=IF(B2>=I2,IF(B2<=M2,"Y", "N"),"N")
 
Upvote 0
I think your data may not be recognized as dates. It wasn't for me when I copied and pasted your information, even after I ensured the values were numbers by multiplying by 1.

When I manually keyed the dates in, it works (and yes, I did add a second False statement.
 
Upvote 0
Nested IFs are often tricky. Try:-
Code:
=IF(AND([COLOR=blue]B2>=I2[/COLOR],[COLOR=magenta]B2<=M2[/COLOR][COLOR=black]),"Y","N")[/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,502
Messages
6,179,126
Members
452,890
Latest member
Nikhil Ramesh

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