HH:MM:SS Formula!!

TheLostFormula

New Member
Joined
Dec 1, 2017
Messages
1
Hi all, i'm usually good with formulas but this ones got me crazy, i'm trying to add up a bill because i think my network provider is pulling a fast one:

I'm trying to add a these sort of formats:

http://imgur.com/a/U2FyN

Thanks for your help guys!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi, welcome to the forum!

Try to post example data that covers all the possibilities directly in a reply to this thread and explain what the expected results should be in relation to that example data.

Images are not helpful, as any potential helpers out there would need to manually type out all of the values from the image into a spreadsheet to test with.
 
Upvote 0
I agree with user FormR. That said....

The following demonstrates a formula to convert all possible forms of dates in your image.

Code:
    A             B
1   12h           12:00:00
2   12h:34m       12:34:00
3   12h:34m:56s   12:34:56
4   12m            0:12:00
5   12m:34s        0:12:34
6   12s            0:00:12

B1: =IF(COUNTIF(A1,"*h*"), IF(COUNTIF(A1,"*m*"),
        --SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"h",""),"m",""),"s",""), --SUBSTITUTE(A1,"h",":0")),
    IF(COUNTIF(A1,"*m*"), IF(COUNTIF(A1,"*s*"),
       --SUBSTITUTE(SUBSTITUTE(A1,"m",""),"s",".0"), --SUBSTITUTE(A1,"m",":0.0")),
    --("0:" & SUBSTITUTE(A1,"s",".0"))))

Copy B1 into B2:B6
Format B1:B6 as Custom [h]:mm:ss

To sum a column of such dates, use the following array-entered formula (press ctrl+shift+Enter instead of just Enter):

Code:
=SUM(IF(ISNUMBER(SEARCH("h",A1:A100)), IF(ISNUMBER(SEARCH("m",A1:A100)),
        --SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1:A100,"h",""),"m",""),"s",""), --SUBSTITUTE(A1:A100,"h",":0")),
    IF(ISNUMBER(SEARCH("m",A1:A100)), IF(ISNUMBER(SEARCH("s",A1:A100)),
       --SUBSTITUTE(SUBSTITUTE(A1:A100,"m",""),"s",".0"), --SUBSTITUTE(A1:A100,"m",":0.0")),
    IF(ISNUMBER(SEARCH("s",A1:A100)),  --("0:" & SUBSTITUTE(A1:A100,"s",".0")), 0))))

formatted as Custom [h]:mm:ss
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,617
Latest member
Narendra Babu D

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