Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
DAY BETWEEN TWO DATES AND TIME
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
DAY BETWEEN TWO DATES AND TIME
Try this out - edit the ranges to match your date locations - never tried
this before, but i think this will get the answer u need. Dim tst As Variant Dim tst1 As Variant Dim tst3 As Variant tst1 = DateDiff("d", Range("G12"), Range("H12")) tst = DateDiff("h", Range("G12"), Range("H12")) / 24 tst = Left(tst, 4) tst = Right(tst, 3) If tst = 0.29 Then tst3 = tst1 + 1 Else tst3 = tst1 End If MsgBox tst3 Devin " wrote: I would like to know how many days between two dates and time. Exemple: 1 Dec 14:00 to 3 Dec 21:00, will be 2 days but I want to know how many days it will when you go over 6 hours more than the 24 hours. The exemple shown it will be 3 days. You can reply via my email: |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
DAY BETWEEN TWO DATES AND TIME
Here is a formula solution
=INT(B1-A1)+1+(MOD((B1-A1),1)0.25)*1 -- HTH ------- Bob Phillips "DMoney" wrote in message ... Try this out - edit the ranges to match your date locations - never tried this before, but i think this will get the answer u need. Dim tst As Variant Dim tst1 As Variant Dim tst3 As Variant tst1 = DateDiff("d", Range("G12"), Range("H12")) tst = DateDiff("h", Range("G12"), Range("H12")) / 24 tst = Left(tst, 4) tst = Right(tst, 3) If tst = 0.29 Then tst3 = tst1 + 1 Else tst3 = tst1 End If MsgBox tst3 Devin " wrote: I would like to know how many days between two dates and time. Exemple: 1 Dec 14:00 to 3 Dec 21:00, will be 2 days but I want to know how many days it will when you go over 6 hours more than the 24 hours. The exemple shown it will be 3 days. You can reply via my email: |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
DAY BETWEEN TWO DATES AND TIME
Do I have to make a MACRO for this one?
|
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
DAY BETWEEN TWO DATES AND TIME
This is give me 4 days not 3. Thanks
|
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
DAY BETWEEN TWO DATES AND TIME
Sorry, mi-read part, try
=INT(B1-A1)+(MOD((B1-A1),1)0.25)*1 instead -- HTH ------- Bob Phillips "BonjourMonde" wrote in message oups.com... This is give me 4 days not 3. Thanks |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
DAY BETWEEN TWO DATES AND TIME
Thanks, it works.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linking computer dates (time) to spreadsheet dates that have formu | Excel Worksheet Functions | |||
Working with dates and time | New Users to Excel | |||
Subtracting Dates to get total time work time excluding weekends | Excel Discussion (Misc queries) | |||
Calculating time between two dates | Excel Discussion (Misc queries) | |||
Time between two dates | Excel Discussion (Misc queries) |