How to add AM/PM to a cell

keithjones33

New Member
Joined
Dec 9, 2016
Messages
12
I have an excel spreadsheet which I am trying to improve. One of the columns is based on whether a shift was a morning shift (AM) or an afternoon shift (PM). currently it is using a data validation and I have to pick from a drop down list. Is there a formula that automatically inputs either AM or PM based on the systems clock. I have tried a few things but nothing works, do I have to use VBA which I am a complete novice.

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

bugmonsta

Board Regular
Joined
Dec 17, 2013
Messages
214
Hi,
You could format your cells to a custom format of h:mm AM/PM, if you use a 24hr clock it will automatically add the AM/PM to the time for you

14:00 becomes 2:00 PM and 02:00 or 2:00 becomes 2:00 AM
 

keithjones33

New Member
Joined
Dec 9, 2016
Messages
12
Hi,
You could format your cells to a custom format of h:mm AM/PM, if you use a 24hr clock it will automatically add the AM/PM to the time for you

14:00 becomes 2:00 PM and 02:00 or 2:00 becomes 2:00 AM

Thanks bugmonsta. Not quite what I want to do. I just want to show AM or PM (not the time) based on the system clock. for example if the clock is showing between 00:01 and 11:59 I want the cell to show just AM, if the clock shows between 12.00 and 12:00 then I want the cell to show just PM.
 

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,502
Office Version
  1. 365
Platform
  1. Windows
Hi, you could try:

=TEXT(NOW(),"AM/PM")
 

keithjones33

New Member
Joined
Dec 9, 2016
Messages
12
Hi FormR, that worked a treat. Thanks. I didn't think of using "Text" formula. Again thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,130,281
Messages
5,641,303
Members
417,203
Latest member
cheesegeneman

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
Top