Getting an answer in hours and tenths of hours

Woodmangler

New Member
Joined
Dec 9, 2015
Messages
4
Hi

I have read and re-read so many posts on this - I am just not getting the answer I need - probably my reading and comprehension skills :LOL:

OK...

Cell C3 has "Start time" in military time cell is formatted Special "Codigo Postal" - someone somewhere said to choose "Special" to get the military time to show all 4 characters, i.e. "0800" not being automatically converted to "800"

Cell D3 has "End time" in military time - 1630 - everything else is the same as C3

Cell E3 has the formula =SUM(D3-C3)/100 -E3 and is formatted Number - 2 decimal places

The answer in E3 is 8.30 - I need it to read 8.5

I am lost....
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi

You need to format your cells as Number > Custom > hh:mm
That is the correct format for time
Then E3=(D3-C3) would yield a result of 0.35 (assuming you had formatted this cell as Number, 2 dec places
That is because Excel stores times as fractions of a day (24 hours) so
E3=(D3-C3)*24 will yield your result of 8.5
 
Upvote 0
Hi

I have read and re-read so many posts on this - I am just not getting the answer I need - probably my reading and comprehension skills :LOL:

OK...

Cell C3 has "Start time" in military time cell is formatted Special "Codigo Postal" - someone somewhere said to choose "Special" to get the military time to show all 4 characters, i.e. "0800" not being automatically converted to "800"

Cell D3 has "End time" in military time - 1630 - everything else is the same as C3

Cell E3 has the formula =SUM(D3-C3)/100 -E3 and is formatted Number - 2 decimal places

The answer in E3 is 8.30 - I need it to read 8.5

I am lost....
Is this what you want??
Excel Workbook
CDE
3080016308.50
Sheet14
 
Upvote 0
If the times in C3 and D3 (0800, 1630) are formatted like this "hh:mm;@", then something like this should work

Code:
=HOUR(D3-C3)+MINUTE(D3-C3)/60

You will want the formatting for this cell to be general or number though because 8.5 is not a time.
 
Upvote 0
Is this what you want??
Sheet14

*CDE
3080016308.50

<colgroup><col style="width: 30px; font-weight: bold;"><col style="width: 64px;"><col style="width: 64px;"><col style="width: 64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
E3=INT((D3-C3)/100)+MOD((D3-C3)/100,1)*100/60

<tbody>
</tbody>

<tbody>
</tbody>
Excel tables to the web >> Excel Jeanie HTML 4

If so, here is a shorter formula which I think will return the same value as your formula...

=24*TEXT(D3-C3,"0\:00")
 
Upvote 0
Hi

You need to format your cells as Number > Custom > hh:mm
That is the correct format for time
Then E3=(D3-C3) would yield a result of 0.35 (assuming you had formatted this cell as Number, 2 dec places
That is because Excel stores times as fractions of a day (24 hours) so
E3=(D3-C3)*24 will yield your result of 8.5

"You need to format your cells as Number > Custom > hh:mm"

When I format the cell that way, entering any military time yields "00.00" no matter what I enter
 
Upvote 0
Cell C3 has "Start time" in military time cell is formatted Special "Codigo Postal" - someone somewhere said to choose "Special" to get the military time to show all 4 characters, i.e. "0800" not being automatically converted to "800"

Cell D3 has "End time" in military time - 1630 - everything else is the same as C3

Simply format as Custom 0000.

(That might be same as Special "Codigo Postal". I don't know. I don't have that Special option. Custom 0000 is universally accepted.)

=INT((D3-C3)/100)+MOD((D3-C3)/100,1)*100/60
=24*TEXT(D3-C3,"0\:00")

Choose a different example to demonstrate the error in these suggestions. Try 0830 in C3 and 1600 in D3.

Both formulas return about 8.167. The correct answer is 7.5, which is returned by:

=24*(TEXT(D3,"00\:00")-TEXT(C3,"00\:00"))

We cannot subtract D3-C3 directly because that treats the righthand 2 digits as parts of 100 instead of parts of 60. So 1600 - 0830 = 0770 instead of 0730.

PS.... The suggestions to format C3 and D3 as Custom hh:mm are incorrect because you are entering time without the colon, in the first place. Consequently, 0830 and 1600 are interpreted as 830 and 1600 days after 12/31/1899; that is, the dates 4/9/1902 and 5/18/1904.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,810
Messages
6,121,690
Members
449,048
Latest member
81jamesacct

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