If formula with time

HockeyDiablo

Board Regular
Joined
Apr 1, 2016
Messages
182
Not too good working with time in excel. But what I would like to do is write a formula in an adjacent cell:

If the time is;

06:00-10:00 = AM1
10:00-12:00 = AM2
12:00-14:00 = MID1
14:00-16:00 = MID 2
16:00-18:00 = PM1
18:00-22:00 = PM2
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You can try something along the lines of

ABCDE
1TimeValueTimeValue
20:017:00AM1
36:00AM1
410:00AM2
512:00MID1
614:00MID2
716:00PM1
818:00PM2
922:00

<tbody>
</tbody>

E2 =LOOKUP(D2,$A$2:$A$9,$B$2:$B$9)
 
Last edited:
Upvote 0
You can try something along the lines of

ABCDE
1TimeValueTimeValue
20:017:00AM1
36:00AM1
410:00AM2
512:00MID1
614:00MID2
716:00PM1
818:00PM2
922:00

<tbody>
</tbody>

E2 =LOOKUP(D2,$A$2:$A$9,$B$2:$B$9)


way easier than: =IF((AND(K2>=0.25,K2<=1.416667)),"AM1",IF((AND(K2>4.16667,K2<=0.5)),"AM2",IF((AND(K2>0.5,K2<=0.58333)),"MID1",IF((AND(K2>0.58333,K2<=0.666667)),"MID2",IF((AND(K2>0.666667,K2<=0.75)),"PM1",IF((AND(K2>0.75,K2<=0.916667)),"PM2","AH"))))))

ty
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,262
Members
449,075
Latest member
staticfluids

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