Time Conversion Into Decimal Numbers w/Custom Format

Disarmonious

Board Regular
Joined
Oct 31, 2016
Messages
139
I have a column (D) where the user will be required to enter in minutes and seconds into cells (D5-D44). (I only want to work with minutes and seconds, no hours). All cells under this column are custom formatted to "00\:00", which auto-converts numbers typed in to minutes and seconds; For example, the user types "4545" which is converted to '45:45' (45 minutes and 45 seconds).

In another column (J), I have cells (J5-J44) that converts time into decimals. All cells under this column are formatted to 'Number' (00.00) with a formula "=TEXT(D5,"00\:00)+0". When I type "4545" to get '45:45' in cell D5, cell J5 converts it to 1.91? I was hoping to get "45.75". I don't understand why I'm getting "1.91", and would like to know how to get '45.75', the real decimal time for 45 minutes and 45 seconds instead of '1.91'?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Another way:

A​
B​
2​
45:45​
Format of A2: 00\:00
3​
45.75​
A3: =DOLLARDE(A2/100, 60)
 
Upvote 0
try this formula

=FIXED(D5/100,0)+MOD(D5,100*FIXED(D5/100,0))/60

Awesome! Works like a charm! Thank you very much for your help!

Now that it works, I'm actually interested in how this formula (long formula that is) converts time into the correct decimal. I studied the formula, but it doesn't entirely make sense. If you have time, would you mind breaking this formula down for me?
 
Upvote 0
The value in the cell is actually 4545 (4,545) even if it is formatted with the colon in the middle.
The long formula first gets the hundreds value by dividing by 100 and dropping (fixing) the decimals.
Then it determines the value that is left over (MOD) when dividing the original value by the hundreds value (formula repeated) and
divides by 60 to make the decimal a portion of a minute.

Wow, that DollarDE formula is cool. I was not aware of that one.
 
Upvote 0
You might want to go with the DollarDE formula.... the "long" formula does not work for values less than 1 minute, or with seconds entered above 60 seconds.
 
Upvote 0

Forum statistics

Threads
1,216,165
Messages
6,129,235
Members
449,496
Latest member
Patupaiarehe

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