• =DAY() question (Excel 2003 SP2)

    Author
    Topic
    #448587

    I searched Woody’s and could not find the answer, so I will ask the experts.
    I have the Analysis Toolpak loaded.

    Cell A3 contains the date (either by entering it or by using =NOW() function)
    If I use =WORKDAY(A3,0) and format the answer ddd dd, it shows Wed 13 (correct day of the week and correct day number).
    If I use =DAY(A3) and format the same way as above, it indicates the weekday is Fri but the day number is correct.
    Any idea why?

    Thanks

    Viewing 1 reply thread
    Author
    Replies
    • #1097391

      The result of WORKDAY is a date.
      The result of DAY is a number – the number of the day within the month; for today (the 13th of Februari) the result is 13. You should *not* format the result as a date – it will be interpreted as the 13th of Januari 1900 which happened to be a Friday…

      • #1097392

        Hans,

        Thanks for the quick response and the explaination.
        I KNEW I could count on the Lounge for the answer.

    • #1097396

      In addition to what Hans has said, from what I see you do not need either the WORKDAY or the DAY functions in this case. You could just format A3 as “ddd dd”. If you need the result in another cell, then in that cell you could just use =A3 and format that cell as “ddd dd”.

      • #1097398

        Legare,

        Thanks. I was just trying to check out the various functions and see what they could do. Somewhere I came across an Excel workbook (XL_FunctionList.xls) that listed all the various functions and showed how to use them and I thought it indicated you could get the day of the week from the DAY() function. Just wanted to know if I was doing something wrong or not.
        Thanks for the reply.

        • #1097401

          =Weekday(A3) or =Weekday(A3,1) yields a number 1 (sunday) – 7 (Saturday)
          =Weekday(A3,2) yields a number 1 (Monday) – 7 (Sunday)
          =Weekday(A3,2) yields a number 0 (Monday) – 6 (Sunday)

          =TEXT(A3,”ddd”) yields “Sun” – “Sat”
          =TEXT(A3,”dddd”) yields “Sunday” – “Saturday”

          Steve

    Viewing 1 reply thread
    Reply To: Reply #1097398 in =DAY() question (Excel 2003 SP2)

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

    Your information:




    Cancel