+ Reply to Thread
Results 1 to 8 of 8

Sumproduct if conditions are met

  1. #1
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Sumproduct if conditions are met

    Hi,

    I'm having one of those days where my brain just isn't getting it, so please can you help a brother out.

    I've attached an example, using sumproduct to COUNT an array. Unfortunately it's not quite working. I've highlighted the cells yellow with the answer I'm getting and green with what it should be.

    The idea is to COUNT how many rows have a value for the location based on if it's "Prelim" or "Classification".

    For location V026 there 8 rows with a value greater than 0 in the "prelim" category, but because there are two columns the value I'm getting is 9
    For location V026 there 4 rows with a value greater than 0 in the "classification" category, but because there are four columns the value I'm getting is 13

    Would appreciate your help

    Thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Sumproduct if conditions are met

    Try this;

    Cell M1:

    Please Login or Register  to view this content.
    Cell M2:

    Please Login or Register  to view this content.

    Change 0,001 to 0.001 according to your regional settings.

  3. #3
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Sumproduct if conditions are met

    Thanks for responding.

    I've condensed the sheet down a lot from the real example - it wouldn't be possible to break each column down i.e do D, E, F etc separately, sorry I should have stated this previously

  4. #4
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Sumproduct if conditions are met

    Then, try this:

    Array formulas, that has to be confirmed by Ctrl+Shift+Enter

    In cell M1:

    Please Login or Register  to view this content.

    In Cell M2:

    Please Login or Register  to view this content.

    Change 0,001 to 0.001 and/or ";" to "," depending on your regional settings.
    Last edited by Haluk; 07-21-2020 at 10:36 AM.

  5. #5
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Sumproduct if conditions are met

    @mrsak87;

    You've not responded my last message whether your problem is solved or not but, a sample file is also attached below...
    Attached Files Attached Files

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

    Re: Sumproduct if conditions are met

    Key Perlim, Classification in I1, I2
    then
    L2
    =SUM((MMULT((B$3:G$28)*(B$1:G$1=I1),SEQUENCE(COLUMNS(B$3:G$28)))>0)*(A$3:A$28=J1))

    or M2 calculate faster for 10,000 more rows and columns
    =SUM(N(MMULT(--FILTER(FILTER(B$3:G$28,A$3:A$28=J1),B$1:G$1=I1),SEQUENCE(COUNTIFS(B$1:G$1,I1)))>0))
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Sumproduct if conditions are met

    Guys!

    Both these solutions are beautiful! Thanks as well for the headsup on a large data set - if I could award extra bonus points I would.

    thanks again

  8. #8
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Sumproduct if conditions are met

    You're welcome...

+ 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. Sumproduct with Conditions
    By oyeoro in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-08-2019, 09:47 PM
  2. SUMPRODUCT with conditions
    By Steve_Courts in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-24-2013, 05:33 AM
  3. sumproduct with if conditions
    By Unnati in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-10-2012, 03:53 AM
  4. [SOLVED] Help with sumproduct with two conditions
    By pstewart in forum Excel General
    Replies: 1
    Last Post: 08-21-2012, 03:24 PM
  5. Sumproduct with conditions?
    By voraciousV in forum Excel General
    Replies: 1
    Last Post: 02-07-2009, 02:33 AM
  6. sumproduct three conditions
    By Scire in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-09-2006, 01:25 PM
  7. Sumproduct with two conditions(or more)
    By hellZg8 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-03-2006, 01:55 PM

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