• Excel Year Function (XP)

    Author
    Topic
    #365949

    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

    Viewing 0 reply threads
    Author
    Replies
    • #566168

      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

      • #566205

        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 . I took the formulas out, recreated them, and they are working fine again.

        Thank you for your reply!
        Kathy

    Viewing 0 reply threads
    Reply To: Excel Year Function (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: