challenging formula(for me), counting days between dates formultiple years
Karthik wrote:
Sorry i am not clear of your query but this formula will give you the
duration between 2 dates
in A1 enter the first date, B1 enter the second date and in C1
=datedif(A1,B1,"d")
d represents days
m represents months
y represents years
Hope this is on similar lines
Thanks,
Maybe I wasnt clear enough, here is what I want to do:
We harvest a product, when the product is harvested it is considered
"green" until a set number of days passes, and these days have to be
between the 15th of May and the 15th of Nov in any given year. Any days
the product sits that aren't between those dates are not considered
"drying" days.
So, I have a sheet with several columns, included are harvested date and
delivered date, I need to insert a column that calculates the "drying
days" the product sat from the time it was harvested until the time it
was delivered. This is where it gets tricky..
For example, if the product was harvested on Nov 10th 2005, and
delivered on Dec 15 2005, there would be 5 drying days counted. If the
product was delivered on Jan 31st 2006 it is still only 5 drying days,
however if the product was delievered AFTER May 15, 2006 then any days
falling after May 15th 2006 also count as "drying days" in addition to
the 5 in 2005, so if the delivery date was May 20 2006 the number of
drying days I need the formula to calculate is 10.
It is also possible that the product may not be delivered until 2007 for
example, so in a nutshell I need to calculate all days the product has
sat between the dates 15-may and 15-nov of any given year, and it could
span 2 or more years.
I have done a formula using an IF formula with a nested AND in it that
works, but the delivered date needs to be in the same year, which is
often not the case.
Here is an example:
Harvested Delivered Drying days
10-05-2003 20-05-2003 5
10-05-2003 20-12-2003 184
10-05-2003 20-05-2004 189
I entered the Drying days numbers in the above example, but I want a
formula to do this for me.
I hope that makes it clearer!
TG
|