Microsoft Excel querry

sunilbt

New Member
Joined
Mar 28, 2011
Messages
4
Hi Excel expert,

I have been struggling with a querry in the excel sheet.

As shown in the below excel picture. I have been trying to calculate the time taken between column D and Column C.And I want the difference in "number of days" "Hours" and "minutes".


If see below in the column 'E" is it is showing me as "1 day" "0" hours and "57" minutes. Rather it should show me as "0" days "0" hours and "57" mintutes.

C D E
moz-screenshot.png
moz-screenshot-1.png
moz-screenshot-2.png
moz-screenshot-3.png
moz-screenshot-4.png
moz-screenshot-5.png
<table border="0" cellpadding="0" cellspacing="0" width="350"><col style="width: 96pt;" width="128"> <col style="width: 81pt;" width="108"> <col style="width: 86pt;" width="114"> <tbody><tr style="height: 54pt;" height="72"> <td class="xl71" style="height: 54pt; width: 96pt;" width="128" height="72">CORR compile started</td> <td class="xl71" style="border-left: medium none; width: 81pt;" width="108">CORR delivered</td> <td class="xl71" style="border-left: medium none; width: 86pt;" width="114">CORR creation time</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl69" style="height: 12.75pt;" height="17"> </td> <td class="xl69" style="border-left: medium none;"> </td> <td class="xl70" style="border-left: medium none;"> </td> </tr> <tr style="height: 13.5pt;" height="18"> <td class="xl68" style="height: 13.5pt;" height="18"> </td> <td class="xl68" style="border-left: medium none;"> </td> <td class="xl70" style="border-left: medium none;"> </td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl72" style="height: 12.75pt;" height="17">4/24/2010 10:30</td> <td class="xl72" style="border-left: medium none;">4/24/2010 11:27</td> <td class="xl73" style="border-left: medium none;">01 00:57</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl68" style="height: 12.75pt;" height="17">5/1/2010 10:30</td> <td class="xl68" style="border-left: medium none;">5/1/2010 11:21</td> <td class="xl70" style="border-left: medium none;">01 00:51</td> </tr> </tbody></table>

Could you please help mw with the right formula?

Regards,
Sunil.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
This maybe?
Excel Workbook
ABCDE
14/24/2010 10:304/24/2010 11:270Hours :57minutes :00seconds<< Format Cell - Custom: [h]"Hours" :mm"minutes" :ss"seconds"
25/1/2010 10:305/1/2010 11:210Hours :51minutes :00seconds
Sheet1
Excel 2007
Cell Formulas
RangeFormula
C1=B1-A1
 
Upvote 0
Crude, but this will get you there -- I'm SURE there is a better way, unknown to me at the time... LOL - so this is FWIW.
Excel Workbook
ABCDEFGH
1Start TimeEnd TimeHoursMinutesDaysHoursMinutesConcatenated
24/24/11 10:30 AM4/24/11 11:27 AM0570.000.0057.000 Days, 0 hours and 57 minutes
35/1/11 10:30 AM5/1/11 11:21 AM0510.000.0051.000 Days, 0 hours and 51 minutes
4******** YOU COULD HIDE COLUMNS C - G ********
Sheet1
Excel 2007
Cell Formulas
RangeFormula
C2=INT((B2-A2)*24)
D2=((B2-A2)*24-C2)*60
E2=INT(C2/24)
F2=C2-(E2*24)
G2=ROUND(D2,0)
H2=E2 & " Days, " & F2 & " hours and " &G2 & " minutes"
 
Upvote 0
Crude, but this will get you there -- I'm SURE there is a better way, unknown to me at the time... LOL - so this is FWIW.


Excel Workbook
ABCDEFGH
1Start TimeEnd TimeHoursMinutesDaysHoursMinutesConcatenated
24/24/11 10:30 AM4/24/11 11:27 AM0570.000.0057.000 Days, 0 hours and 57 minutes
35/1/11 10:30 AM5/1/11 11:21 AM0510.000.0051.000 Days, 0 hours and 51 minutes
4******** YOU COULD HIDE COLUMNS C - G ********
Sheet1
Excel 2007
Cell Formulas
RangeFormula
C2=INT((B2-A2)*24)
D2=((B2-A2)*24-C2)*60
E2=INT(C2/24)
F2=C2-(E2*24)
G2=ROUND(D2,0)
H2=E2 & " Days, " & F2 & " hours and " &G2 & " minutes"

Hi,

Thanks For your trick.This works if there is only few vlaues.
If i hide the columns C-G.. How about for next values.Do i need to make manual entry of these formulas everytime i have new values in Column A and Column B?

I tried hiding the columns C-G and then just put the values for A4 and B4.But I didnt get the desired output in the column H4.

Regards,
Sunil.
 
Upvote 0
Hi,

Thanks For your trick.This works if there is only few vlaues.
If i hide the columns C-G.. How about for next values.Do i need to make manual entry of these formulas everytime i have new values in Column A and Column B?

I tried hiding the columns C-G and then just put the values for A4 and B4.But I didnt get the desired output in the column H4.

Regards,
Sunil.
 
Upvote 0
You would paste in your dates/times to Column A and Column B

the formulas in Columns C - H would be copied down as far as you have data in Columns A & B
 
Upvote 0
Hi Jim,

I am not getting right values for all the time stamps :(..I would be more happy to get one formula instead of multiple formulas.I really appreciate your support..

Regards,
Sunil.
 
Upvote 0
Substituting the individual formulas into the lead formula you get:

=INT(C2/24) & " Days, " & C2-(E2*24) & " hours and " &ROUND(D2,0) & " minutes"

that's all I can offer!!
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,544
Members
452,925
Latest member
duyvmex

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