Converting date and hours format

kasbac

Active Member
Joined
Jan 2, 2008
Messages
344
I have a cell that contains a count down to a specific time. The count down appears like this:

10d 23:18:43

Is it possible to write a formula that will convert the count down to hh:mm:ss?

In the above i would expect:

263:18:43

Note that if a single day is left the cell looks as such:

1d 23:18:43

Thanks in advance!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
to be honest Rick I am not sure. I was not the creator of the workbook. It is connected to an external source from where it pulls in this value if that helps in any way?
 
Upvote 0
to be honest Rick I am not sure. I was not the creator of the workbook. It is connected to an external source from where it pulls in this value if that helps in any way?

So then, the cells contain constant values, not a formulas, correct? If so, select one of those cells... is what is displayed in the cell the same as what is displayed in the Formula Bar? In addition to that question, what are the cells' format... Text?
 
Upvote 0
So then, the cells contain constant values, not a formulas, correct? If so, select one of those cells... is what is displayed in the cell the same as what is displayed in the Formula Bar? In addition to that question, what are the cells' format... Text?

Yes the value is constant and the value in the cell and the formula bar is the same. The cell format is "General"
 
Upvote 0
The following clunky thing should work. Just replace A1 with whatever cell you are referencing. I was not sure whether it would have "0d" if the countdown target is tomorrow, so I included a check for it just in case. Also, if it shows up without days, Excel might treat it as a time value, so I pushed that to text to match the rest of the output in case you were using it in downstream formulas.
=IF(ISNUMBER(A1), TEXT(A1, "HH:MM:SS"), IF(ISERROR(SEARCH(" ", A1)), A1, (VALUE(MID(A1, SEARCH(" ", A1) + 1, 2)) + VALUE(LEFT(A1, SEARCH(" ", A1) - 2)) * 24) & RIGHT(A1, 6)))
 
Upvote 0
Here is another formula that should work...

=TEXT(LEFT(A1,SEARCH("d",A1)-1)+TEXT(MID(A1,FIND(" ",A1)+1,8),"h:mm:ss"),"[h]:mm:ss")
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,246
Members
452,623
Latest member
cliftonhandyman

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