# Thread: Excel Year Function (XP)

1. ## Excel Year Function (XP)

This is from an expense voucher worksheet. I'm wanting to test the date and apply different mileage rates based on whether the date is in 2001 or 2002. Here's the formula I'm working with:
=IF(YEAR(A8)=2001,C8*0.345,C8*0.365)
Cell A8 has a date of, say, 1/17/02 with a date format of mm/dd/yy.

As a test, just taking =Year(A8) as a formula results in 6/24/1905 in a cell that is formatted as a date.

Thanks!
Kathy

2. ## Re: Excel Year Function (XP)

From what I can see you formula works as required.

With regard to Year(A8) returning June 24 1905, it is actualy correct, as Excel counts it's dates from 1/1/1900. so 2001(=Year(A8), assuming that date is in year 2001) days represents that number of days from 1/1/1905 which is 24 June 1905.

Andrew C

3. ## Re: Excel Year Function (XP)

Yes, it did work as required. There seems to be a rash of "now you see it, now you don't" errors going on right now <sigh>. I took the formulas out, recreated them, and they are working fine again.