Convert Xmos Xw Xd Xh Xm Xs format to calendar days

Dentine

New Member
Joined
Dec 31, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I receive a report with data as listed below. I've found a number of formulas that will convert Xd Xh Xm Xs to an HH:MM format, however, I have not found anything that can account for the Xw (weeks) or Xmos (months). I can edit from HH:MM to calendar days myself, but have not been able to format any entry with Xw or Xmos included. With ~8,000 entries, doing this manually is not an option. If anyone can suggest an option, it would be greatly appreciated.


54m 22s
55m 19s
1h 2m 57s
1h 11m 18s
2w 3d 5h 22m 0s
2w 3d 4h 19m 56s
1mos 0w 0d 15h 26m 51s
1mos 0w 0d 15h 21m 51s
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
What result do you require?
Do you want the result in equivalent days and if so is a month = 30 days?
 
Upvote 0
No additional information was received.
The following may help.

Time.xlsm
AB
1
2
354m 22s00:54:22
455m 19s00:55:19
51h 2m 57s01:02:57
61h 11m 18s01:11:18
72w 3d 5h 22m 0s17:5:22:0
82w 3d 4h 19m 56s17:4:19:56
91mos 0w 0d 15h 26m 51s30:15:26:51
101mos 0w 0d 15h 21m 51s30:15:21:51
1195.85733796
12
4a
Cell Formulas
RangeFormula
B3:B6B3=--IF(ISERROR(FIND("h",A3)),TEXTJOIN(":",,TEXTSPLIT("0h"&A3,{"h","m","s"})),TEXTJOIN(":",,TEXTSPLIT(A3,{"h","m","s"})))
B7:B8B7=TEXTBEFORE(A7,"w")*7+TEXTAFTER(TEXTBEFORE(A7,"d")," ")+LET(t,TEXTAFTER(A7,"d "),--IF(ISERROR(FIND("h",t)),TEXTJOIN(":",,TEXTSPLIT("0h"&t,{"h","m","s"})),TEXTJOIN(":",,TEXTSPLIT(t,{"h","m","s"}))))
B9:B10B9=TEXTBEFORE(A9,"mos")*30+TEXTBEFORE(TEXTAFTER(A9,"mos "),"w")*7+TEXTAFTER(TEXTBEFORE(TEXTAFTER(A9,"mos "),"d")," ")+LET(t,TEXTAFTER(TEXTAFTER(A9,"mos "),"d "),--IF(ISERROR(FIND("h",t)),TEXTJOIN(":",,TEXTSPLIT("0h"&t,{"h","m","s"})),TEXTJOIN(":",,TEXTSPLIT(t,{"h","m","s"}))))
B11B11=SUM(B3:B10)
 
Upvote 0
Solution
Apologies for the delayed response. The formulas provided are perfect! Thank you!
 
Upvote 0
Thanks for the feedback.
You may be able to assemble the formulas into one so that you can fill or copy down for the relevant range of data.
 
Upvote 0

Forum statistics

Threads
1,225,398
Messages
6,184,731
Members
453,254
Latest member
topeb

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