Need help on formatting cell value

khuharshree

New Member
Joined
May 11, 2018
Messages
3
Hi Friends,

I am looking for help to convert values

FROM:
05-01-2018-01.15

<tbody>
</tbody>

TO:

05/01/2018 01.15 AM


Appreciate your help on this

Thanks
Khuharshree
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I doubt thats a value, more likely a text date/time.
Where does it come from?
test with =isnumber(cell-ref)...FALSE indicates text and it will need to be converted

If it IS text, you could probably do it with SUBSTITUTE()
 
Upvote 0
Hi Ford,

Thanks for your reply. Actually I am running script which further gets me values in above format i.e. 05-01-2018-01.15 which I needs to covert it to 05/01/2018 01.15 AM

In short I am trying to get Stop Time and Start Time in this format
05/01/2018 01.15 AM . This will allow me to use MINUTE formula to calculate downtime.
 
Upvote 0
Welcome to the forum.

I have assumed all of that data will be of the format month-day-year-time, all of them being exactly 16 characters long. Put 05-01-2018-01.15 in cell A1 and this formula in your worksheet:

Code:
=DATEVALUE(LEFT(A1,10))+RIGHT(SUBSTITUTE(A1,".",":"),5)

Then use a custom number format with exactly this as the Type: mm/dd/yyyy hh:m AM/PM.
 
Last edited:
Upvote 0
Super, I'm glad it worked. You're welcome.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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