+ Reply to Thread
Results 1 to 9 of 9

Weekday function not working correctly?

  1. #1
    Registered User
    Join Date
    04-24-2017
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    Weekday function not working correctly?

    Hi everyone,

    First post so sorry if it's not up to scratch. I'm using excel for a University assignment and I have to use the weekday function. What I am trying to acheive is having all the dates come up as numbers corresponding to the days. Instead I am getting a name error, I'm new at excel this is the first time I've ever used it so I am unsure of what to do. If I don't get a name error it gives me some silly date but no numbers. I'm also trying to figure out how to do something with the times on the excel sheet. I've added the excel file and the instructions I was given, the weekday and time instructions are on page 4 of the pdf. If anybody can help that would be great.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Weekday function not working correctly?

    What have you tried so far?
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    04-24-2017
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    Re: Weekday function not working correctly?

    I've tried changing the return type, ctrl shift and enter and changing the date format. My class isn't on statistics or excel they just kind of threw a random task at us. There were tutorials provided by the uni but I get the error message when I follow them. I'm a complete newbie at excel so I'm completely lost on even trouble shooting.

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Weekday function not working correctly?

    Page4 of your Pdf file, its all right there in black red and green. Doesnt say anything about ctrl shift and enter


    You could create a new variable called dayofweek using the WEEKDAY function in Excel (there’s something very similar in SPSS). This will give you for each day a number 1 to 7. This will correspond to the days of the week. Make sure you understand the ‘type’ argument of the function. Depending on what you do, one type results in Sunday = 1, Monday = 2, ... Saturday = 7 and the other is Monday = 1, Tuesday = 2, ... Sunday = 7. The second one is better because of the next step.


    So how do you look at weekday/weekend differences? If you’ve got the day of week information it is a breeze. Create a new variable called weekend? and use an IF function to determine if it’s a weekend or not. The function will look something like: IF(dayofweek >5, “YES”, “NO”) What this is doing is testing whether the value for dayofweek is higher than 5, or not. Day of week can only have values 1 to 7. So, if dayofweek is 6 or 7 we get a YES, but NO if it is 1 through 5.

  5. #5
    Registered User
    Join Date
    04-24-2017
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    Re: Weekday function not working correctly?

    Okay, when I follow those steps. What I get after using the WEEKDAY function is the answer 1/7/1904, in the text box. The function I am using is =WEEKDAY (L2,2)

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Weekday function not working correctly?

    Ok so did I. Good Job... Now just highlight the Entire Column and change the cell formatting from date to Number or general

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,891

    Re: Weekday function not working correctly?

    Format Cells as General

  8. #8
    Registered User
    Join Date
    04-24-2017
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    Re: Weekday function not working correctly?

    That got it. Thank you so much for your help.

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Weekday function not working correctly?

    No problem...

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Why is weekday function working like this
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2016, 10:12 AM
  2. IF function not returning expected result
    By kapeller in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-21-2014, 10:12 AM
  3. [SOLVED] Using the Split function with another function incorporated is not working correctly
    By highlystrung in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2013, 03:51 PM
  4. WEEKDAY not working correctly need HELP!!!
    By devil20a in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-25-2012, 11:15 PM
  5. WEEKDAY function not working
    By devil20a in forum Excel General
    Replies: 3
    Last Post: 07-25-2012, 07:58 PM
  6. If function not working correctly
    By lsbeuk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-22-2011, 09:26 PM
  7. Lookup function still not working correctly
    By Mike K in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1