Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    =DAY() question (Excel 2003 SP2)

    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
    Attached Files Attached Files
    Chuck Reimer
    I'm from the Government and I'm here to help...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: =DAY() question (Excel 2003 SP2)

    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...

  3. #3
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: =DAY() question (Excel 2003 SP2)

    Hans,

    Thanks for the quick response and the explaination.
    I KNEW I could count on the Lounge for the answer.
    Chuck Reimer
    I'm from the Government and I'm here to help...

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: =DAY() question (Excel 2003 SP2)

    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".
    Legare Coleman

  5. #5
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: =DAY() question (Excel 2003 SP2)

    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.
    Chuck Reimer
    I'm from the Government and I'm here to help...

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: =DAY() question (Excel 2003 SP2)

    =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

  7. #7
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: =DAY() question (Excel 2003 SP2)

    Thanks Steve.
    Chuck Reimer
    I'm from the Government and I'm here to help...

Posting Permissions

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