Is Date in between two dates. True/False?

jackfox68

Board Regular
Joined
Jan 24, 2010
Messages
121
Hi Everyone,

I am trying to write a formula that will return a value of either true or false if a cell contains a date that is equal too or greater than a starting dates, and equal to or less than an ending date. So for example starting date in cell A1 is 10/1/2014 and end date in cell A2 is 10/31/2014. The date to evaluate in cell A3 is 10/2/2014. The formula I attempted to use was with the AND function and went as follows:

'=AND(A3>=A1,A3<=A2)

For some reason this always returns a false argument.

Any help would be appreciated.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Code:
=AND(A3>=A1,A3<=A2)

It returns true for me. You can force it a little bit my using:

Code:
=AND(DATE(YEAR(A3),MONTH(A3),DAY(A3))>=DATE(YEAR(A1),MONTH(A1),DAY(A1)),DATE(YEAR(A3),MONTH(A3),DAY(A3))<=DATE(YEAR(A2),MONTH(A2),DAY(A2)))
 
Upvote 0
It returns TRUE for me as well, are you sure you have your cell references correct?

This should also work: =MEDIAN(A1:A3)=A3

<b>Sheet1</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:75px;" /><col style="width:75px;" /><col style="width:64px;" /><col style="width:64px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td >*</td><td >A</td><td >B</td><td >C</td><td >D</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="text-align:right; ">10/1/2014</td><td >*</td><td style="text-align:right; ">TRUE</td><td style="text-align:right; ">TRUE</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="text-align:right; ">10/31/2014</td><td >*</td><td >*</td><td >*</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="text-align:right; ">10/2/2014</td><td >*</td><td >*</td><td >*</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b>Spreadsheet Formulas</b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >C1</td><td >=AND(A3>=A1,A3<=A2)</td></tr><tr><td >D1</td><td >=MEDIAN(A1:A3)=A3</td></tr></table></td></tr></table> <br /><br /><span style="font-family:Arial; font-size:9pt; font-weight:bold;background-color:#ffffff; color:#000000; ">Excel tables to the web >> </span>
 
Upvote 0

First - thanks for your replies. However, I am still coming up short :( Either I am not implementing your solution correctly, or I was not sufficiently describing the ask. Hopefully you can see the example below, which I hope will help to ensure I am explaining what I need more accurately. So - to reiterate my ask (sorry for the redundancy), If the date in column K is either equal to or greater than the date in Cell 035 and equal to or less than the date in Cell P35 then the value returned in P would be True, else the value returned would be false.

Thanks again for your help


Excel 2010
KLMNOP
3510/1/201410/31/2014
36
37Go Live DateDays in ProdLeft in ClassPF/FT
389/28/20143310PT91.548387FALSE
3910/2/20142910FT160.90323FALSE
4010/5/20142610PT72.129032FALSE
4110/12/20141910PT52.709677FALSE
4210/19/20141210FT66.580645FALSE
4311/2/2014-210FT-11.09677FALSE
4411/16/2014-1610FT-88.77419FALSE

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
New Hire Worksheet

Worksheet Formulas
CellFormula
O35=P35-Q34+1
P35=EOMONTH(TODAY(),1)
N38=IF(OR(E38=$U$34),"PT","FT")
O38=IF(N38="PT",L38*($R$35/$Q$34),L38*($S$35/$Q$34))
P38=AND(K38>=$O$35,K38<=$P$35)
N39=IF(OR(E39=$U$34),"PT","FT")
O39=IF(N39="PT",L39*($R$35/$Q$34),L39*($S$35/$Q$34))
P39=AND(K39>=O35,K39<=P35)
N40=IF(OR(E40=$U$34),"PT","FT")
O40=IF(N40="PT",L40*($R$35/$Q$34),L40*($S$35/$Q$34))
P40=AND(K40>=$O$35,K40<=$P$35)
N41=IF(OR(E41=$U$34),"PT","FT")
O41=IF(N41="PT",L41*($R$35/$Q$34),L41*($S$35/$Q$34))
P41=AND(K41>=$O$35,K41<=$P$35)
N42=IF(OR(E42=$U$34),"PT","FT")
O42=IF(N42="PT",L42*($R$35/$Q$34),L42*($S$35/$Q$34))
P42=AND(K42>=$O$35,K42<=$P$35)
N43=IF(OR(E43=$U$34),"PT","FT")
O43=IF(N43="PT",L43*($R$35/$Q$34),L43*($S$35/$Q$34))
P43=AND(K43>=$O$35,K43<=$P$35)
N44=IF(OR(E44=$U$34),"PT","FT")
O44=IF(N44="PT",L44*($R$35/$Q$34),L44*($S$35/$Q$34))
P44=AND(K44>=$O$35,K44<=$P$35)
L38=$P$35-K38
L39=$P$35-K39
L40=$P$35-K40
L41=$P$35-K41
L42=$P$35-K42
L43=$P$35-K43
L44=$P$35-K44

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Correction - I just attempted the solution provided below and it worked fine! Thank you kindly, I can not tell you how much I appreciate the help. Questions, can anyone tell me why my original formula is not working?

Code:
=AND(A3>=A1,A3<=A2)

It returns true for me. You can force it a little bit my using:

Code:
=AND(DATE(YEAR(A3),MONTH(A3),DAY(A3))>=DATE(YEAR(A1),MONTH(A1),DAY(A1)),DATE(YEAR(A3),MONTH(A3),DAY(A3))<=DATE(YEAR(A2),MONTH(A2),DAY(A2)))
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,414
Members
448,895
Latest member
omarahmed1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top