Inserting duration in a column without using colon and adding them up

masud8956

Board Regular
Joined
Oct 22, 2016
Messages
163
Office Version
  1. 2016
  2. 2011
  3. 2007
Platform
  1. Windows
I have a column with 56 rows. I want to insert duration in [h]:mm format without having to type colon. For that I formatted input cells using 0\:00 to get a return at row 57. The problem is, while adding up those duration I am getting erroneous results.

e.g. 0:30 and 0:40 are added up as 0:70 but I expected 1:10.

What did I do wrong? Is there any solution without using VBA?

Thanks in advance.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
check
Code:
=(mod(A1,100)/60+int(A1/100))/24+(mod(A2,100)/60+int(A2/100))/24
and format cell with formula as [h]:mm


or
Code:
=text(mod(A1,100)/60+int(A1/100))/24+(mod(A2,100)/60+int(A2/100))/24,"[h]:mm")

to sum from whole column you would need use similar approach in Array (committed Ctrl+Shift+Enter) formula like:
Code:
=sum((mod(A1:A64,100)/60+int(A1:A64/100))/24)

let me emphasize again it's ARRAY formula.
 
Upvote 0
Sorry to bother you again!

The MOD function worked perfectly for straight forward calculations! But in one occasion in the same sheet I am in need of using {=SUMIF(TYPE,H146,D_DUAL)} function where I have filtered data basing on a drop down list (TYPE, D_DUAL). What I have done is I have used {=SUM((MOD(I146,100)/60+INT(I146/100))/24)} function in another row just to convert the result in the form of {h}:mm. Problem is the results are erroneous. e.g. 0:45+0:45+0:45 adds up to 1:35 where as it should had been 2:15. Here to mention that all my input data are in 0\:00 format. I want the output in [h]:mm format.

How can I fix it?

Thanks in advance!
 
Upvote 0
Try summing hours and minutes separately.
something like:
{=SUM(MOD(I1:I200,100)/60/24)+SUM(INT(I1:I200/100)/24)}
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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