Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Bloomington, Indiana, USA
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Bloomington, Indiana, USA
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

    Thank you for your reply!
    Kathy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •