Change date format (years, days, hours) to days

Fjura

New Member
Joined
Jan 17, 2017
Messages
5
Hello,

May I ask if someone knows how I could change this kind of format (years, days, hours) for example: "220 y 344 d 12 h" to a number of days?



So "220 y 344 d 12 h" would be "80644,50"

thanks!
 
I have slightly different solution if want to try:

If all your data is in Column A
I will highlight column A, select "Text to Columns" from the data Tab
Select "Delimited" and select next
Tick only the "space" delimiter and click next once again
Choose the columns that's have "y", "d" and "h" and select the format "Do not import column (skip)
Set Destination as =$B$1
Click Finish.
You now have years, days and hours in separate columns.
A simple formula in E1 will give you the result you want: =(B1*365)+C1+(D1/24)

thanks man, this is pretty cool solution!
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,214,832
Messages
6,121,853
Members
449,051
Latest member
excelquestion515

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