+ Reply to Thread
Results 1 to 4 of 4

COUNTIFS with multiple criteria across non-contiguous ranges

  1. #1
    Forum Contributor
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    110

    COUNTIFS with multiple criteria across non-contiguous ranges

    Hi All,

    I'm looking for a fomula to replace/streamline the below multiple instances of COUNTIFS adding together. Essentially I need a COUNTIFS with multiple criterai accross non-contiguous ranges.

    =COUNTIFS(Model!$D$24:$D$9999,$E5,Model!$F$24:$F$9999,">="&J$4,Model!$F$24:$F$9999,"<"&EDATE(J$4,1))+
    COUNTIFS(Model!$D$24:$D$9999,$E5,Model!$G$24:$G$9999,">="&J$4,Model!$G$24:$G$9999,"<"&EDATE(J$4,1))+
    COUNTIFS(Model!$D$24:$D$9999,$E5,Model!$H$24:$H$9999,">="&J$4,Model!$H$24:$H$9999,"<"&EDATE(J$4,1))+
    COUNTIFS(Model!$D$24:$D$9999,$E5,Model!$I$24:$I$9999,">="&J$4,Model!$I$24:$I$9999,"<"&EDATE(J$4,1))+
    COUNTIFS(Model!$D$24:$D$9999,$E5,Model!$J$24:$J$9999,">="&J$4,Model!$J$24:$J$9999,"<"&EDATE(J$4,1))+
    COUNTIFS(Model!$D$24:$D$9999,$E5,Model!$K$24:$K$9999,">="&J$4,Model!$K$24:$K$9999,"<"&EDATE(J$4,1))

    Any help will be greatly appreciated

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,205

    Re: COUNTIFS with multiple criteria across non-contiguous ranges

    Well, you say non-contiguous ranges, but then in your sample the date ranges are all contiguous (unless you're referring to column D). So, if all the comparisons of dates are in contiguous cells like your sample, you could try this:

    =SUM((Model!D24:D9999=E5)*(Model!F24:K9999>=J$4)*(Model!F24:K9999<EDATE(J$4,1)))

    If the dates aren't contiguous, then this doesn't help much, but it's a little shorter than your COUNTIFS formula:

    =IFERROR(ROWS(FILTER(Model!D24:D9999,(Model!D24:D9999=E5)*
    ((Model!F24:F9999>=J$4)*(Model!F24:F9999<EDATE(J$4,1))+
    (Model!G24:G9999>=J$4)*(Model!G24:G9999<EDATE(J$4,1))+
    (Model!H24:H9999>=J$4)*(Model!H24:H9999<EDATE(J$4,1))+
    (Model!I24:I9999>=J$4)*(Model!I24:I9999<EDATE(J$4,1))+
    (Model!J24:J9999>=J$4)*(Model!J24:J9999<EDATE(J$4,1))+
    (Model!K24:K9999>=J$4)*(Model!K24:K9999<EDATE(J$4,1))))),0)

    If these don't help you, please attach a sample file so we have something to test with.

  3. #3
    Forum Contributor
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    110

    Re: COUNTIFS with multiple criteria across non-contiguous ranges

    Hi Gregb11,

    You're right, in the sample formula I provided the ranges were not non-contiguous ranges, although your initial formula work perfectly for this example. And, your additional formula will help when I have the need to move to non-contiguous ranges.

    Thank you very much for you help, it is greatly appreciated.

    Thread marked as solved and rep added.

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,205

    Re: COUNTIFS with multiple criteria across non-contiguous ranges

    You're welcome, and thanks for the rep and feedback.

+ 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. Countifs with multiple named ranges as criteria
    By mmytb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2024, 09:26 AM
  2. SUMIFS, COUNTIFS, & SUMPRODUCT - With multiple cell ranges & criteria
    By Iamcourtdz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-18-2020, 11:19 AM
  3. [SOLVED] Countifs with multiple criteria and ranges within single column?
    By Skiptomylou in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-13-2018, 12:56 PM
  4. [SOLVED] countifs statement with multiple criteria for multiple criteria ranges
    By mcdermott2 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-07-2015, 11:48 AM
  5. [SOLVED] Help with Countifs in multiple ranges & multiple criteria
    By earlcarl13 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-01-2015, 11:41 PM
  6. Replies: 5
    Last Post: 05-04-2014, 10:56 AM
  7. Replies: 4
    Last Post: 03-30-2013, 08:36 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