Full Version: Dateif - Count Days Between Two Dates
rjAccDB

Hello UA,

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..

Many thanks,
rj
Jeff B.
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"?
rjAccDB
Hello Jeff,

Yes a physical date,.. ie a leave from 14-Apr-12 to 30-Apr-12 = 17 days (this includes Sat & Sun..).

Many thans,
rj
Jeff B.
Not sure I saw your answer to my secondary question ... are you only considering "whole" days off?
dflak
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.
rjAccDB
Hi Jeff,