Apr 13 2012, 11:23 AM
Am trying to use this formula/function: =DateIf(a1,b1, "D") to count the days between A1 - B1.. there are instances that it gives the correct count, and there are instances that it is less than 1 to the actual count.. (usage is to count the days of vacation leave for an employee - so count start from the first day to the last day of leave.. i.e. "01-Apr-12 to 30-Apr-12 = 30 days..
Can someone please help me on this..
Apr 13 2012, 11:27 AM
Are you measuring/recording physical dates, or date/time values? Would you consider someone who took 4 hours of leave as having taken "1 day"?
Apr 13 2012, 12:06 PM
Yes a physical date,.. ie a leave from 14-Apr-12 to 30-Apr-12 = 17 days (this includes Sat & Sun..).
Apr 13 2012, 12:42 PM
Not sure I saw your answer to my secondary question ... are you only considering "whole" days off?
Apr 13 2012, 03:09 PM
It seems like this formula should work: =INT(B2) - INT(A2) + 1 where A2 is the start date and B2 is the end date. The INTs wrapped around the dates assures we're dealing with whole days and don't suffer the loss or gain of a day due to rounding.
Apr 14 2012, 06:25 AM
Sorry,..I overlooked your other question..
Yes, we only consider here "whole" day, as we count days not hours..
Hope I satisfied your question.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here