Convert number to Date and Time

Ri_star

New Member
Joined
Jul 21, 2022
Messages
5
Office Version
  1. 2019
Platform
  1. Windows
Hi All,
I have three cells.
In one cell there is Date, in 2nd cell there is time and in last cell there is AM/PM.
I wanted all of them in one call so I concatenate them but after that I am getting result as 45300 0.486006944444444 AM.
Can anyone please help me. How can I change it to Date and Time Format?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Excel actually stores dates and times, specifically the number of days since 1/0/1900 (and time is just the fractional component of one day, i.e. 6:00 AM is equal to 0.25 since 6/24 is 0.25).
So, to combine date and time, you would just add up those two cells, and then apply a date/time format to the resulting cell.
That should work, as long as your entries are entered as real date/times, and not as strings.

For the AM/PM part, you may just need to add 12 hours (0.5), i.e.
if AM or PM is in cell A3, then the part of the formula would look something like:
Excel Formula:
... + IF(A3="PM",0.5,0)
 
Upvote 0
Solution
Excel actually stores dates and times, specifically the number of days since 1/0/1900 (and time is just the fractional component of one day, i.e. 6:00 AM is equal to 0.25 since 6/24 is 0.25).
So, to combine date and time, you would just add up those two cells, and then apply a date/time format to the resulting cell.
That should work, as long as your entries are entered as real date/times, and not as strings.

For the AM/PM part, you may just need to add 12 hours (0.5), i.e.
if AM or PM is in cell A3, then the part of the formula would look something like:
Excel Formula:
... + IF(A3="PM",0.5,0)
Thank you so much for the quick help Joe4. It worked.
 
Upvote 0
You are welcome.
Glad I was able to help!
 
Upvote 1

Forum statistics

Threads
1,215,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

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