Formula to return word based on time of day data is entered

Dscalf1

New Member
Joined
Jun 14, 2015
Messages
41
I need a formula to return the word (first, second or third) based on the time of day information is entered in another cell.

So for example if cell AT6 were to change at 13:45:00 i want the word first to show up in cell BA6

First: 6:01-14:00
Second: 14:01-22:00
Third: 22:01-6:00
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
You need to change your table slightly since 00:01 will not be greater than 22:01, so early morning hours will never be picked up as being in the Third group.
Do it this way.

In Sheet2!A1:C4

Code:
Third   00:00    06:00
First   06:01    14:00
Second  14:01    22:00
Third   22:01    23:59

in BA6
=INDEX(Sheet2!A$1:A$4,MATCH(AT6,Sheet2!B$1:B$4,1),1)
 
Last edited:
Upvote 0
Another option:

Cell AT6 = 13:45:00

Formula for BA6:
Code:
IF(AT6="","",IF(OR(TIMEVALUE(TEXT(AT6,"HH:MM"))>11/12,TIMEVALUE(TEXT(AT6,"HH:MM"))<=1/4),"Third",IF(AND(TIMEVALUE(TEXT(AT6,"HH:MM"))>7/12,TIMEVALUE(TEXT(AT6,"HH:MM"))<=11/12),"Second","First")))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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