Datedif Question


Posted by Donna on August 23, 2001 6:48 AM

How do I find the difference between a date in a cell and today's date? This is the formula that I have so far: =DATEDIF(E4,"Now()","D")

But this keeps giving me errors. Additionally, should this field be set to a date type or number type?

Thanks,
Donna

Posted by Mark W. on August 23, 2001 7:11 AM

=TODAY()-E4

Posted by Caleb N. Diffell on August 23, 2001 7:24 AM

Mark W has the right idea. The =Today() function accepts no arguments in Excel (you can't put anything in the parenthesis), but it will give today's date. Excel can then subtract another date from it to arrive at the difference. This is because dates are stored in excel as numbers, with January 1, 1900 being 1; January 2, 1900 being 2; and so on. Because excel stores these numbers internally, it does not matter which date format your cells are in; they can be in different date formats if you desire.

Posted by Caleb on August 23, 2001 7:29 AM

Donna,

You can also "age" your items (I assume that's why you're finding the difference between dates) with this formula:

=IF((TODAY())-K2<31,"0-30",IF((TODAY())-K2<61,"31-60",IF((TODAY())-K2<91,"61-90",IF((TODAY())-K2<121,"91-120","121+"))))

(this uses K2 as the date you're subtracting from). This will create an aging category (0-30, 31-60, 61-90, 91-120, and 121+) for each line item in your list.

-Caleb



Posted by Donna on August 23, 2001 7:37 AM

Thanks!!