Add characters to the start of cell, if cell contains a certain number of characters

Chookz

Board Regular
Joined
May 9, 2011
Messages
95
I have encountered a problem with my data set. My export data lists 24 minutes 30 seconds as 24:30, however the computer reads this as 24 hours thirty minutess (as 1 hour 24 minutes 30 seconds is displayed as 1:24:30).
Can i enter a formula/formulas to say:
If cell is 4 characters, add 0: to the start of the cell
If cell is 3 characters, add 0:0 to the start of the cell
If cell is 2 characters, add 0:00: to the start of the cell, and
If cell is 1 character, add 0:00:0
So that 24:30 would read 0:24:30, 5:36 would read 0:05:36 and 20 would read 0:00:20?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
How is 30 seconds exported?
Hi Andrew,
Im not sure as im home now and the file is on my computer at work. So far ive only had exports of hours (eg. 02:22:15) and minutes (eg. 5:36). But there is the potential that data may be exported in seconds. It doesnt make sense that 30 seconds would export as 30, so im assuming it would export as 0:30.
Any help you can give me would be greatly appreciated
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,242
Members
452,898
Latest member
Capolavoro009

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