ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   "Is Between" function? (https://www.excelbanter.com/excel-worksheet-functions/5682-%22-between%22-function.html)

Cindi

"Is Between" function?
 
Is there an "Is Between" function? I want to say the
following, but I don't know how.

If Today() is between "10/15/04" and "10/24/04", then 1,
but if today() is between "10/25/04" and "11/01/04", then
2....and so on, and so on, and so on....

How do I do this??? Please help!

Thanks,

Cindi

N Harkawat

Use AND function as follows:-
=If(and(today()"10/15/04",today()< "10/24/04"),1,if(and(....
"Cindi" wrote in message
...
Is there an "Is Between" function? I want to say the
following, but I don't know how.

If Today() is between "10/15/04" and "10/24/04", then 1,
but if today() is between "10/25/04" and "11/01/04", then
2....and so on, and so on, and so on....

How do I do this??? Please help!

Thanks,

Cindi




Alex Delamain


If you want it to go on and on it will get messy! Here is the formula
for "is it between two dates" returning 1 if it is and 0 if it isn't.
(you could replace the 0 with the formula repeated for a second set of
dates and so on)

=if(and(today()=date(2004,10,15),today()<=date(20 04,11,01)),1,0)

However is there a pattern to your start and end dates as this might
allow a simpler method?


--
Alex Delamain
------------------------------------------------------------------------
Alex Delamain's Profile: http://www.excelforum.com/member.php...o&userid=11273
View this thread: http://www.excelforum.com/showthread...hreadid=275344


Harlan Grove

"Cindi" wrote...
Is there an "Is Between" function? I want to say the
following, but I don't know how.

If Today() is between "10/15/04" and "10/24/04", then 1,
but if today() is between "10/25/04" and "11/01/04", then
2....and so on, and so on, and so on....


There are different numbers of days between 10/15/04 and 10/24/04 - 10 days
including both the 15th and the 24th - and between 10/25/04 and 11/01/04 - 8
days inclusive. If your periods span different numbers of days, the best
approach is using LOOKUP. Something like

=LOOKUP(TODAY(),--{"10/15/04";"10/25/04";"11/02/04";"11/20/04"},
{1;2;3;4})



Domenic


Assuming that Column A contains your dates as follows...

10/15/2004
10/25/2004
etc.

=MATCH(TODAY(),A1:A10,1)

Adjust the range accordingly. Notice only the start dates are listed.
I couldn't continue with the list since I didn't see any discernable
pattern.

Hope this helps!


--
Domenic
------------------------------------------------------------------------
Domenic's Profile: http://www.excelforum.com/member.php...o&userid=10785
View this thread: http://www.excelforum.com/showthread...hreadid=275344



All times are GMT +1. The time now is 07:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com