![]() |
date between ?
Can anyone suggest how to go about testing whether a date is between two
other dates? I'd like to know if a date falls in a certain quarter. THANKS |
date between ?
You can do it as below example:
Dim a As Date, b As Date, c As Date a = DateSerial(2005, 1, 1) b = DateSerial(2004, 1, 1) c = DateSerial(2003, 1, 1) If (b < a Or b < c) And (b a Or b c) Then MsgBox "YES! (between)" Else MsgBox "NO! (not between)" End If You can replace < with <= AND with = if you want to include the limits. Sharad "HotRod" wrote in message .. . Can anyone suggest how to go about testing whether a date is between two other dates? I'd like to know if a date falls in a certain quarter. THANKS |
date between ?
If the two dates are in A1 and A2, and your test date is in B1, then use
=IF(AND(B1=A1,B1<=A2),"Yes","No") -- HTH RP (remove nothere from the email address if mailing direct) "HotRod" wrote in message .. . Can anyone suggest how to go about testing whether a date is between two other dates? I'd like to know if a date falls in a certain quarter. THANKS |
All times are GMT +1. The time now is 01:53 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com