+ Reply to Thread
Results 1 to 5 of 5

Count items that match multiple criteria including date using WEEKNUM

  1. #1
    Forum Contributor
    Join Date
    07-01-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2016
    Posts
    161

    Count items that match multiple criteria including date using WEEKNUM

    I have attached a sample spreadsheet. On the List Summary worksheet, cell C4, I am trying to take a formula similar to B4:

    Please Login or Register  to view this content.
    The code in B4 should meet the following - right now, the count is off, and I don't know why
    • Count all items in 'Master Matrix'!$B$7:$B$200 that match the initials in A4 (KP)
    • Of the items above, how many do not have 'Received', 'Processed', or 'N/A' in 'Master Matrix'!$C$7:$C$200
    • Of the items above, how many have a due date that is past


    The code I want in C4 should meet the following.
    • Count all items in 'Master Matrix'!$B$7:$B$200 that match the initials in A4 (KP)
    • Of the items above, how many do not have 'Received', 'Processed', or 'N/A' in 'Master Matrix'!$C$7:$C$200
    • Of the items above, how many have the same WEEKNUM as WEEKNUM(NOW()) --- this is so if an item is due on Wednesday, it doesn't matter if it is Monday or Friday of the same week, the value will be 1

    The code I want in D4 should be
    • Count all items in 'Master Matrix'!$B$7:$B$200 that match the initials in A4 (KP)
    • Of the items above, how many do not have 'Received', 'Processed', or 'N/A' in 'Master Matrix'!$C$7:$C$200
    • Of the items above, how many have the same WEEKNUM is <= (less than or equal to) WEEKNUM(NOW())

    E4 should just be =SUM(B4:E4). Could someone help me with these formulas (no VBA)?
    Attached Files Attached Files

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Count items that match multiple criteria including date using WEEKNUM

    I guess this should do the trick.
    Added a column Wnum to the matrix, because weeknum can't be used on an array.

    BTW, I think you should check the ranges your formulas are refering to.
    Attached Files Attached Files
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  3. #3
    Forum Contributor
    Join Date
    07-01-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2016
    Posts
    161

    Re: Count items that match multiple criteria including date using WEEKNUM

    Tsjallie - Thanks for the info and the tip. The reason my range was to 200 was in case I added any additional lines. Got any tips on how I can not need to define the range with my formula (remember, I do have column headers of a few rows that need to be excluded)?

  4. #4
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Count items that match multiple criteria including date using WEEKNUM

    Turn the Matrix into a table. That will auto expand when adding rows below it. Also auto copies any formulas.
    Here's an example of how that would look.
    One warning though: if in the Matrix table there are rows added or removed by a macro then Excel might crash because of the conditional formatting in the table.
    So in that case you need to choose between a nice layout and the advantages of a table, which are readability of yr formulas and maintainability of the data.
    Attached Files Attached Files
    Last edited by Tsjallie; 09-19-2018 at 04:04 PM.

  5. #5
    Forum Contributor
    Join Date
    07-01-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2016
    Posts
    161

    Re: Count items that match multiple criteria including date using WEEKNUM

    I didn't want to create an additional column, but in this instance, it's helpful. I'll just hide it. Also, went with your idea of a table.

+ 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] Index Match with multiple criteria including date range
    By Perk1961 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-11-2017, 08:23 PM
  2. Count which includes multiple columns including multiple criteria
    By Zou in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-27-2017, 10:43 AM
  3. [SOLVED] Count and sum with multiple criteria including date range
    By Perk1961 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-23-2016, 04:46 PM
  4. Replies: 16
    Last Post: 05-25-2015, 08:51 AM
  5. Replies: 6
    Last Post: 04-20-2015, 07:22 AM
  6. [SOLVED] Need to count items in column that match multiple data items
    By bclucas55 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-27-2014, 10:03 AM
  7. [SOLVED] Count based on 3 criteria including date range
    By timarcarze in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 06-13-2013, 01:43 AM

Tags for this Thread

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