ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   formula for dates (https://www.excelbanter.com/excel-worksheet-functions/136316-formula-dates.html)

ghynes

formula for dates
 
hello..

im looking for formula which will give me an output related to the date.

heres what i am looking for.
i have a list of work shifts in column A, and start date in column B and end date in column C. i need an output on a diff cell to tell me the shift thats working on the present day.

SHIFTC 3/27/2007 7:00 3/27/2007 19:00
SHIFTD 3/27/2007 19:00 3/28/2007 7:00
SHIFTC 3/28/2007 7:00 3/28/2007 19:00
SHIFTB 3/28/2007 19:00 3/29/2007 7:00
SHIFTA 3/29/2007 7:00 3/29/2007 19:00
SHIFTB 3/29/2007 19:00 3/30/2007 7:00
SHIFTA 3/30/2007 7:00 3/30/2007 19:00
SHIFTD 3/30/2007 19:00 3/31/2007 7:00

the cell with the function would output SHIFTC as today is 3/27/2007 12:08 and then would change to SHIFTD when the time would change to 3/27/2007 19:00.

can you help?

Sandy Mann

formula for dates
 
I don't think that you need the second column of dates/times

With the shift s in column A and the dates/times in column B try:

=INDEX(A1:A8,SUM(--(B1:B8<NOW())))

Array enters with Crtl + Shift + Enter

Or

=INDEX(A1:A8,SUMPRODUCT(--(B1:B8<NOW())))

Nurmally entered.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"ghynes" wrote in message
...

hello..

im looking for formula which will give me an output related to the
date.

heres what i am looking for.
i have a list of work shifts in column A, and start date in column B
and end date in column C. i need an output on a diff cell to tell me
the shift thats working on the present day.

SHIFTC 3/27/2007 7:00 3/27/2007 19:00
SHIFTD 3/27/2007 19:00 3/28/2007 7:00
SHIFTC 3/28/2007 7:00 3/28/2007 19:00
SHIFTB 3/28/2007 19:00 3/29/2007 7:00
SHIFTA 3/29/2007 7:00 3/29/2007 19:00
SHIFTB 3/29/2007 19:00 3/30/2007 7:00
SHIFTA 3/30/2007 7:00 3/30/2007 19:00
SHIFTD 3/30/2007 19:00 3/31/2007 7:00

the cell with the function would output SHIFTC as today is 3/27/2007
12:08 and then would change to SHIFTD when the time would change to
3/27/2007 19:00.

can you help?




--
ghynes





All times are GMT +1. The time now is 10:46 AM.

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