![]() |
|
#2
|
|||
|
|||
|
I believe this may be because DATEDIF insists on the first argument being less than or equal to the second argument. You get away with it in the B2 formula because you're comparing days so Excel ignores everything after the '17/06/2010'.
If you change B3 to "=IF(DATEDIF(A2,A3,"d")=0,B2,B2+1)" then you get 2 as the result. If your column A isn't in date order, so that you can't assume the date in one row is less than or equal to the date in the following row, then the best answer I can think of is to use the date functions to isolate the parts of the date you want to test, e.g. "=IF(AND(YEAR($A1) = YEAR($A2), MONTH($A1) = MONTH($A2), DAY($A1) = DAY($A2)), $B1, $B1 + 1)" Hope that helps. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Actual working hours per day | climbatron | Project | 2 | 12-17-2015 03:13 PM |
calendar -reduced working hours
|
pm_newbie | Project | 7 | 01-17-2012 10:34 AM |
How to add hours together
|
PomDave | Excel | 3 | 09-05-2011 04:43 AM |
| Cell with hours | meninio | Excel | 3 | 02-11-2011 06:50 AM |
Date and time calcs excluding non-working hours
|
mrsatchmo | Excel | 1 | 01-26-2011 08:50 AM |