Convert Unconventional D:H:M Counter to Total Minutes

jkerekgyarto

New Member
Joined
Jan 5, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I need to convert these cells that contain elapsed time in the format shown, to total minutes.

The data in the cell is texts and numbers – there is a space on both sides of each number.

The formula is a Value function with a nested Find – it’s not working for me, however.

=VALUE(LEFT(A2,FIND("D",A2)-2))*24*60 + VALUE(LEFT(A2,FIND("D",A2)-3))*24*60 + VALUE(MID(A2,FIND(":",A2)+2,FIND("H",A2)-2))*60 + VALUE(LEFT(A2,FIND("M",A2)-2))

The position of the characters in the cells is not static – see the difference between A2 and A3.

Image of cells in spreadsheet is uploaded.

Any help is very appreciated.
 

Attachments

  • Screenshot 2021-01-05 151313.png
    Screenshot 2021-01-05 151313.png
    5.2 KB · Views: 6

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
48,400
Office Version
  1. 365
Platform
  1. Windows
Welcome to the MrExcel board!

Do you have the LET function in your Excel 365?

21 01 06.xlsm
AB
1StatusTotal Minutes
2DOWN for 7 D : 13 H : 8 M10868
3Sector for 12 D : 2 H : 16 M17416
DHM
Cell Formulas
RangeFormula
B2:B3B2=LET(lng,RIGHT(SUBSTITUTE(A2," ",REPT(" ",20)),160),LEFT(lng,20)*1440+MID(lng,60,20)*60+MID(lng,120,20))
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Watch MrExcel Video

Forum statistics

Threads
1,127,621
Messages
5,625,927
Members
416,143
Latest member
JoyceMB

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