Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking a range of dates 2

Status
Not open for further replies.

AyJayEL

Technical User
Jan 30, 2001
425
GB
I want to check if a Date of birth is within a date range.

DOB Start End Result
1/7/1994 1/9/1993 31/8/1994 False
15/10/19931/9/1993 31/8/1994 True etc

What formula would I use in Result column. I've tried if but I don't know how to specify A2 is between B2 and C2.

Any help gratefully accepted!


Learn something new every day *:->*
AyJayEl
 
This should do it.

=IF(AND(C5>=D5, C5<=D5),"True", "FALSE")


I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 

Hi,

The logic for this is
[tt]
if start <= DOB and DOB >= end then...
[/tt]
however, the syntax in excel is
[tt]
=if(and(start <= DOB,DOB >= end),true expression,false expression)
[/tt]


Skip,

[glasses] [red]Be advised:[/red]To be safe on the FOURTH, don't take a FIFTH on the THIRD, or...
You might not come FORTH on the FIFTH! [tongue]
 
For DHulbert's formula I always get a FALSE result.
For Skip if the date is in the range I get a False, if it is before the range I get a FALSE, it it is after the range I get a True.

Something is not quite right but I can't fathom it. It needs a 'between' statement but I guess Excel can't do this?

Learn something new every day *:->*
AyJayEl
 
duh...

DOB must be LESS THAN OR EQUAL TO end, yes?

is it dyslexia or carelessness?

Skip,

[glasses] [red]Be advised:[/red]To be safe on the FOURTH, don't take a FIFTH on the THIRD, or...
You might not come FORTH on the FIFTH! [tongue]
 
Slight Typo on mine

=IF(AND(A2>=B2, A2<=C2),"True", "FALSE")



I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 
Skip

Looks like we both need to second Coffee to wake up

[sleeping2]

I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 

Yup! Mebe the other guy, too! ;-)

inject that java rat-cheer!

Skip,

[glasses] [red]Be advised:[/red]To be safe on the FOURTH, don't take a FIFTH on the THIRD, or...
You might not come FORTH on the FIFTH! [tongue]
 
Mebe the other guy, too

They guy is a gal [gorgeous] but thanks anyway guys! [love]

Learn something new every day *:->*
AyJayEl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top