![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Fairfax, Virginia
Posts: 3
|
I have a column that has a date/time format of dd/mm/yy hhmm. I need to calculate the amount of hours and minutes (x:xx) between certain entries in the column. Is there any way to do this? I can send a sample if that would make it easier.
Thanks, |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Use =ABS(A1-A2) where cells A1 and A2 contain date values. Format the cell containing this formula as [h]:mm
|
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
Regards,
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Location: Fairfax, Virginia
Posts: 3
|
Sorry guys, but both of the solutions that were given, return an error ($VALUE!). I think the date in the beginning of the field is messing it up. The fields looks like this: 3/6/02 0900 and 3/6/02 1515, which would return a value of 6:15. Hope this helps.
Thanks, |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Mar 2002
Location: Fairfax, Virginia
Posts: 3
|
Yes I do.
|
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Okay, assuming your higher date/time is in cell B1 and the lower one is in cell A1, try this formula:
=TIMEVALUE(LEFT(B1,LEN(B1)-2)&":"&RIGHT(B1))-TIMEVALUE(LEFT(A1,LEN(A1)-2)&":"&RIGHT(A1))+DATEVALUE(LEFT(B1,LEN(B1)-2)&":"&RIGHT(B1))-DATEVALUE(LEFT(A1,LEN(A1)-2)&":"&RIGHT(A1)) NOTE - this formula assumes the format of your times is always the same. That is, the last two characters always represents minutes. Regards,
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|