Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jun 2001
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Weekday Function (ExcelXP)

    Just noticed something interesting with the Weekday function & wondered if anyone had ideas. The formula Weekday(A1) where A1 contains the date 7/29/1973 returns a 1. However, when I enter the same function as Weekday(7/29/1973) I get a 7. After some testing, it seems that Excel is treating what I consider a date as a formula for division and uses the result of the division as a date (.000122 in this case). Is there some symbol that should preceed or encompass the date in order for Excel to read it correctly? I can't imagine that a date couldn't be used directly in such a fucntion. Any ideas?

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

    Re: Weekday Function (ExcelXP)

    You could enter the date as a string: Weekday("7/29/1973")

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

    Re: Weekday Function (ExcelXP)

    Yes, a slash in a formula means division, not a separator in a date. There are a number of ways around this:

    <pre>=WEEKDAY("7/29/1973")
    =WEEKDAY(DATE(1973,7,29))
    =WEEKDAY(DATEVALUE("7/29/1973"))
    </pre>


    These all return the 1 you expect.
    Legare Coleman

  4. #4
    Star Lounger
    Join Date
    Jun 2001
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Weekday Function (ExcelXP)

    It's simple, it works & it's beautiful. Thank you very much!!!!!!!!!!!!!!!!!!

Posting Permissions

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