Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Concatenate including a date so that the date appears as a date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
Making a date go red, if date passes todays date. | Excel Worksheet Functions | |||
Report Date - Date Recv = Days Late, but how to rid completed date | Excel Worksheet Functions | |||
Date updates from worksheet to chart & changes date to a date series! Help!! | Charts and Charting in Excel |