+ Reply to Thread
Results 1 to 6 of 6

Weekday counting from list of dates, ignoring non date cells

  1. #1
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Weekday counting from list of dates, ignoring non date cells

    Hi,

    =SUMPRODUCT((WEEKDAY($B$4:$B$32,2)=E4)*($B$4:$B$32<>""))

    I was hoping that by adding this to the end of my formula, it would ignore cells that are in the range that are not a date(IE Not a number), but it does not.

    When I increase the range to cover B34, I get #value

    How can I modify my formula to overcome this?

    Screenshot 2020-03-27 at 11.50.19.png

    Thanks Leon
    Last edited by Badvgood; 03-27-2020 at 08:35 AM.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Weekday counting from list of dates, ignoring non date cells

    Did you increase both ranges?

    =SUMPRODUCT((WEEKDAY($B$4:$B$99,2)=E4)*($B$4:$B$99>0))

  3. #3
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Re: Weekday counting from list of dates, ignoring non date cells

    Quote Originally Posted by Bo_Ry View Post
    Did you increase both ranges?

    =SUMPRODUCT((WEEKDAY($B$4:$B$99,2)=E4)*($B$4:$B$99>0))
    Yes, increased both ranges. Unfortunately, your solution also gives the same error.

    Attachment 669309

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Weekday counting from list of dates, ignoring non date cells

    Your attachment show "Invalid Attachment specified".

    I guess B33 is null string

    Please try
    =SUMPRODUCT((WEEKDAY(N(+$B$4:$B$99),2)=E4)*($B$4:$B$99<>""))

  5. #5
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Re: Weekday counting from list of dates, ignoring non date cells

    Quote Originally Posted by Bo_Ry View Post
    Your attachment show "Invalid Attachment specified".

    I guess B33 is null string

    Please try
    =SUMPRODUCT((WEEKDAY(N(+$B$4:$B$99),2)=E4)*($B$4:$B$99<>""))
    Perfect, that has got it, thank you.

    What does the N in the formula do exactly?

    Thanks Leon

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Weekday counting from list of dates, ignoring non date cells

    N change text to 0, Weekday can calculate 0 but can't calculate text.

+ 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. Replies: 6
    Last Post: 02-20-2020, 12:44 PM
  2. [SOLVED] check previous weekday date based on a specific dates
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-26-2018, 03:24 AM
  3. Excel VBA code to return weekday name from a date then autofilters for userdefined weekday
    By studyengineering in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2016, 03:24 PM
  4. [SOLVED] Calculate weekday end date based on sum of weekday start date and cell value
    By Rerock in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2014, 09:17 AM
  5. [SOLVED] Counting how many rows fall on a certain date between two other dates in different cells
    By JessHasQuestions in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-29-2014, 10:18 AM
  6. Replies: 2
    Last Post: 10-14-2012, 09:19 AM
  7. Weekday Date List
    By Dave_A in forum Excel General
    Replies: 7
    Last Post: 03-04-2007, 10:53 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