# Returning a value if cell date is between two dates

1. ## Returning a value if cell date is between two dates

hi.

kindly advise on how to return a text value if cell date is between 2 dates.

example, if cell date is between 27oct13-29mar14, i shud get a return
txt 'w13'. if cell date is between 30mar14-25oct14, i shud get a return
txt 's14'.

thank you: -nik-

2. ## Re: Returning a value if cell date is between two dates

try =IF(AND(A1>=41574,A1<=41724),"w13",IF(AND(A1>=41728,A1<=41937),"s14",""))
where your dates are in col A.

3. ## Re: Returning a value if cell date is between two dates

=IF(AND(A1>"27oct13"+0,A1<="29mar14"+0),"w13",IF(AND(A1>="30mar14"+0,A1<="25oct14"+0),"s14",""))

4. ## Re: Returning a value if cell date is between two dates

many thanks for your swift replies, samdo kid & martidwilson.

5. ## Re: Returning a value if cell date is between two dates

Use cells to hold the date ranges:

Data Range
 A B C D E 1 10/27/2013 3/29/2014 ------ 10/27/2013 w13 2 3/30/2014 10/25/2014

This formula entered in E1:

=IF(AND(D1>=A1,D1<=B1),"w13",IF(AND(D1>=A2,D1<=B2),"s14",""))

6. ## Re: Returning a value if cell date is between two dates

thank you, tony.

7. ## Re: Returning a value if cell date is between two dates

You're welcome!

There are currently 1 users browsing this thread. (0 members and 1 guests)