Excel Query for converting time stamp into morning, afternoon, evening and night

sd28649

New Member
Joined
Apr 26, 2018
Messages
1
I have below excel sheet table and I want to convert the given time stamp into morning, afternoon, evening and night. time between 12 am to 11 am - morning, 12 pm to 3 pm- evening, 4 pm to 8 pm- evening, 9 pm to 11 pm- night. Please suggest

[TABLE="width: 128"]
<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl67, width: 64"]Time[/TD]
[TD="class: xl67, width: 64"]Shift[/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]12:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]1:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]2:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]3:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]4:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]5:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]6:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]7:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]8:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]9:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]10:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]11:00 AM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]12:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]1:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]2:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]3:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]4:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]5:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]6:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]7:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]8:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]9:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]10:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl66, align: right"]11:00 PM[/TD]
[TD="class: xl65"] [/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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