View Single Post
  #4   Report Post  
cottage6
 
Posts: n/a
Default need help with formula

Hi Bryan,
There's a function called DATEDIF that is not listed in the regular
functions list that can be used to get the difference between the dates;
=DATEDIF(A1,B1,"D") with the date in A1 being older than the date in B1, and
"D" specifying that you want the number of days between the two dates. This
formula can be used for both sets of dates:
=DATEDIF(A1,B1,"d")+DATEDIF(A2,B2,"d"). You may need to format the cell as
General if the result comes up a date; that should give you your number. The
formula below assumes the number of days between the dates in in cell C1.
=IF(AND(C16,C1<10),C1*1,IF(AND(C110, C1<31),C1*2,IF(C131,C1*3)))
Hope this helps you out.

"Bryan J Bloom" wrote:

I need to subtract 2 different sets of dates to get a total amount of days.
Eg: (a-b)+(c-d) = e
I then need to take the total (e) and multiply by 3 different integers if
the total (e) is greater than 6 days,10 days and 31days.
This helps me keep track how long my company trucks are out of a Rail/Ship
Yard.
I can't seem to get the dates to subtract and get an integer(regular
number). and I'm dead lost on the greater than stuff.
Of course the boss drops this on me on my first day.
Any help or comments will come highly appreciated.
Thank you