+ Reply to Thread
Results 1 to 14 of 14

Having a problem with weekday function not returning the right day

  1. #1
    Registered User
    Join Date
    08-08-2017
    Location
    Tyler, TX United States
    MS-Off Ver
    office 365 pro 2016
    Posts
    7

    Having a problem with weekday function not returning the right day

    Hello I am trying to do 3 things in this formula
    =IF(OR(IFNA(MATCH(C3,$C$4:$C$505,0),""),YEAR(C3)<>YEAR(StartDay)),WEEKDAY(C3),"")
    1.look at column c3:c505 and add blanks in column d when there is a duplicate MATCH(C3,$C$4:$C$505,0),""
    2. have 1 year StartDay=01/6/2018 so if year in column C does not = year of StartDay then also "" YEAR(C3)<>YEAR(StartDay),Weekday(c3),"")
    3. last if both are true then input weekday(c?) in column D Monday, Tuesday, Wednesday...

    Column C is list of Dates Column D is Formula

    This is the Question. I am getting a output of 1/1/1900 instead of Weekday(C). Anyone know Why? I am relatively new at Excel and this is probley a really simple fix lol

    Column C Column D
    c3:c505
    4/1/2018 1/1/1900
    7/1/2018 1/1/1900
    9/2/2018 1/1/1900
    12/2/2018 1/1/1900
    6/3/2018 1/1/1900
    2/4/2018 1/1/1900
    3/4/2018 1/1/1900
    11/4/2018 1/1/1900
    8/5/2018 1/1/1900
    5/6/2018 1/1/1900
    1/7/2018 1/1/1900
    10/7/2018 1/1/1900
    4/8/2018 1/1/1900
    7/8/2018 1/1/1900


    Thanks

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Having a problem with weekday function not returning the right day

    Format the cell with the formula as a number, not a date.

  3. #3
    Registered User
    Join Date
    08-08-2017
    Location
    Tyler, TX United States
    MS-Off Ver
    office 365 pro 2016
    Posts
    7

    Re: Having a problem with weekday function not returning the right day

    getting a value of 1 in column D

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Having a problem with weekday function not returning the right day

    And the weekday function doesn't return the TEXT string version of the weekday, like Monday Tuesday etc.
    It only returns the number. Sunday=1 Monday=2 etc..

    If you want the spelled out weekday word, try replacing WEEKDAY(C3) with TEXT(C3,"dddd")

  5. #5
    Registered User
    Join Date
    08-08-2017
    Location
    Tyler, TX United States
    MS-Off Ver
    office 365 pro 2016
    Posts
    7

    Re: Having a problem with weekday function not returning the right day

    oh ok It was a easy fix Thanks

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Having a problem with weekday function not returning the right day

    You're welcome.

  7. #7
    Registered User
    Join Date
    08-08-2017
    Location
    Tyler, TX United States
    MS-Off Ver
    office 365 pro 2016
    Posts
    7

    Re: Having a problem with weekday function not returning the right day

    ok now I am having another problem all but the Text(c3,"dddd") isn't working. I removed the ifna and match and =IF(YEAR(C3)<>YEAR(StartDay),"",WEEKDAY(C3)) and it works its the other part, that isn't now. If I use the remove duplicates in data tab, when a reference changes will it automatically remove duplicates still?

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Having a problem with weekday function not returning the right day

    Sorry, to this point I've only looked at the output of the weekday, I gave no thought to the overall function of the formula.

    Can you explain in words what the formula is supposed to actually do ?

    do I understand right,

    If the date already exists, return ""
    If the year doesn't match the year of StartDate, return ""
    Otherwise return the weekday ?

  9. #9
    Registered User
    Join Date
    08-08-2017
    Location
    Tyler, TX United States
    MS-Off Ver
    office 365 pro 2016
    Posts
    7

    Re: Having a problem with weekday function not returning the right day

    yes that is right

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Having a problem with weekday function not returning the right day

    Try

    =IF(OR(YEAR(C3)<>YEAR(StartDay),COUNTIF(C$3:C3,C3)>1),"",TEXT(C3,"dddd"))

  11. #11
    Registered User
    Join Date
    08-08-2017
    Location
    Tyler, TX United States
    MS-Off Ver
    office 365 pro 2016
    Posts
    7

    Re: Having a problem with weekday function not returning the right day

    its doing the same thing as =IF(YEAR(A5)<>YEAR(StartDate),"",TEXT(A5,"dddd"))Count if isn't doing anything

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Having a problem with weekday function not returning the right day

    I think you need to attach a sample book, and show your expected results.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  13. #13
    Registered User
    Join Date
    08-08-2017
    Location
    Tyler, TX United States
    MS-Off Ver
    office 365 pro 2016
    Posts
    7

    Re: Having a problem with weekday function not returning the right day

    Figured it out first row =if(year(a1)<>Year(weeklyPD),"",Text(a1,"dddd") this gets rid of just the preceding year dates second row =IF(AND(YEAR(A2)<>YEAR(WeeklyPD),A2=A1),"",TEXT(A2,"dddd"))this is the
    One that I drag down. This gets rid of the years I don't want and checks for duplicates both also adds date name
    Thanks for your help

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Having a problem with weekday function not returning the right day

    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. [SOLVED] WEEKDAY function problem
    By Mikebra in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-12-2013, 03:35 AM
  2. Creating Timeline -- returning a weekday
    By degross77 in forum Excel General
    Replies: 3
    Last Post: 08-05-2010, 04:43 PM
  3. select problem with weekday function
    By bstubbs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2009, 11:03 AM
  4. Problem with the WEEKDAY function
    By petevang in forum Excel General
    Replies: 1
    Last Post: 08-28-2006, 06:28 PM
  5. Problem with XIRR function returning #NUM!
    By Myrna Larson in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  6. [SOLVED] Problem with XIRR function returning #NUM!
    By Francois_Provost in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 01:05 AM
  7. [SOLVED] Problem with XIRR function returning #NUM!
    By Francois_Provost in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-06-2005, 09:05 PM
  8. problem returning a recordset from a function
    By Laurent M in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2005, 06:06 PM

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