ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Comparing 3 dates (https://www.excelbanter.com/excel-worksheet-functions/87599-comparing-3-dates.html)

Steve

Comparing 3 dates
 
Hi
I need a function that will determine whether a date falls between two other
dates. If the date does fall within the time band, the function will return a
"yes", if it doesn't it will return a "no"

Thanks

Steve


macropod

Comparing 3 dates
 
Hi Steve,

If the earliest date is in A1, the latest date in C1 and the test date is in
B1, and all dates are stored as values, you could use something like:
=IF(AND(B1A1,B1<C1),"Yes","No")
This tests whether B1 is *between* A1 and C1.

If you want to include A1 and C1 as valid dates, use something like:
=IF(OR(B1<A1,B1C1),"No","Yes")

Cheers

"Steve" wrote in message
...
Hi
I need a function that will determine whether a date falls between two

other
dates. If the date does fall within the time band, the function will

return a
"yes", if it doesn't it will return a "no"

Thanks

Steve





All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com