Days:Hours:Mins Calculation

kingz

New Member
Joined
Aug 9, 2010
Messages
6
Hi everyone,

i'm tryng to do a calculation between 2 cells

I want it to be days:hours:mins in both & calculate the difference between the 2 (must work either way .. positive or negative)

eg.

32 days 15 hours 5mins

22 days 10 hours 2 mins

= 10 days 5 hours 3 mins
i'm struggling to format & process it correctly! any help will be very much appreciated - many thanks
 
Hi

perhaps this:
Excel Workbook
A
101/01/2010 08:23
209/08/2010 12:53
3220 days 04 hours 29 minutes
Sheet2
Excel 2002
Cell Formulas
RangeFormula
A3=INT(ABS(A1-A2)) & " days " & TEXT(ABS(A1-A2),"hh \h\o\u\r\s mm") & " minutes"
 
Upvote 0
Hi Richard,

thanks for your reply :)

I don't want to calculate between dates - as I don't have that data!
I only have the amount of days, the hours & mins
 
Upvote 0
Hi Richard,

Never seen the "hh \h\o\u\r\s mm" format used before. Interesting stuff.

However, it's strange that the formula evaluates to...

220 days 04 hours 29 minutes

...in your example, but on my PC it evaluates to:

220 days 04 hours 30 minutes

Matty
 
Upvote 0
Hi Richard,

thanks for your reply :)

I don't want to calculate between dates - as I don't have that data!
I only have the amount of days, the hours & mins

What do you have in the cells? Is it literally text like "10 days 5 hours 30 minutes"? How come you have unfriendly non-numerics like this? (it would be so much easier if you had actual numbers)
 
Upvote 0
What do you have in the cells? Is it literally text like "10 days 5 hours 30 minutes"? How come you have unfriendly non-numerics like this? (it would be so much easier if you had actual numbers)


I don't have them in single cells yet I have the data in individual cells but I would like to figure out a way to process them all together & work out the difference

edit: & I am only using numbers .. the text is not necessary ;)
 
Last edited:
Upvote 0
Perhaps like this:
Excel Workbook
ABC
1DaysHoursMinutes
2221545
3101823
4
512.50833
612 days 12 hours 12 minutes
7
Sheet1
Excel 2002
Cell Formulas
RangeFormula
A5=ABS(SUM(A2:C2/{1,24,1440})-SUM(A3:C3/{1,24,1440}))
A6=INT(A5) & " days " & TEXT(A5,"hh ""hours"" mm") & " minutes"
 
Upvote 0
Perhaps like this:

Excel Workbook
ABC
1DaysHoursMinutes
2221545
3101823
4
512.50833
612 days 12 hours 12 minutes
7
Sheet1
Excel 2002
Cell Formulas
RangeFormula
A5=ABS(SUM(A2:C2/{1,24,1440})-SUM(A3:C3/{1,24,1440}))
A6=INT(A5) & " days " & TEXT(A5,"hh ""hours"" mm") & " minutes"


close .. but this doesn't appear to be processing the hours & mins correctly
 
Upvote 0
Sorry, that needed to be array-entered. Here's an alternative (which doesn't require CSE):
Excel Workbook
ABC
1DaysHoursMinutes
2221545
3101823
4
511.89027778
611 days 21 hours 22 minutes
Sheet8
Excel 2002
Cell Formulas
RangeFormula
A5=ABS(SUMPRODUCT((A2:C2-A3:C3)/{1,24,1440}))
A6=INT(A5) & " days " & TEXT(A5,"hh ""hours"" mm") & " minutes"
 
Upvote 0
Sorry, that needed to be array-entered. Here's an alternative (which doesn't require CSE):
Excel Workbook
ABC
1DaysHoursMinutes
2221545
3101823
4
511.89027778
611 days 21 hours 22 minutes
Sheet8
Excel 2002
Cell Formulas
RangeFormula
A5=ABS(SUMPRODUCT((A2:C2-A3:C3)/{1,24,1440}))
A6=INT(A5) & " days " & TEXT(A5,"hh ""hours"" mm") & " minutes"


excellent .. works a treat :)

thank you very much Richard - i'm off to test & reformat slightly
 
Upvote 0

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