+ Reply to Thread
Results 1 to 5 of 5

count across multiple columns with multiple criteria

  1. #1
    Registered User
    Join Date
    02-02-2022
    Location
    Seoul
    MS-Off Ver
    office 2016
    Posts
    2

    count across multiple columns with multiple criteria

    I'm trying to count values that match a certain criteria as attached. The criteria would be same name, same sales number and same percentage point.
    I've tried sumproduct but it is giving me a value of zero.
    Any help would be much appreicated.

    =SUMPRODUCT(--(A4:T4="Name")*(A4:T14="john")*(A4:T4="sale")*(A4:T14=5)*(A4:T4="percentage")*(A4:T14=5))
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: count across multiple columns with multiple criteria

    A giuess, as you didn't tell us what you expect to see!!

    =SUMPRODUCT(($A$5:$Q$14=$I$21)*($B$5:$R$14=H23)*($C$5:$S$14=H23))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    02-02-2022
    Location
    Seoul
    MS-Off Ver
    office 2016
    Posts
    2
    Quote Originally Posted by Glenn Kennedy View Post
    A giuess, as you didn't tell us what you expect to see!!

    =SUMPRODUCT(($A$5:$Q$14=$I$21)*($B$5:$R$14=H23)*($C$5:$S$14=H23))
    Thanks for your input. I already tried this formula but doesnt show the correct value. Ive attached a sample excel file for uour viewing. Thanks

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: count across multiple columns with multiple criteria

    the issue in your current SUMPRODUCT is that you're asking if the value in A5 is John, 5 and 5... and they're mutually exclusive, i.e. you need to offset each range for each test (so when A is John, B = 5 etc)

    =SUMPRODUCT((A4:Q4="Name")*(A4:Q14="john")*(B4:R4="sale")*(B4:R14=5)*(C4:S4="percentage")*(C4:S14=5))

    but, as your field layout repeats, you don't need to do all of that -- i.e. below COUNTIFS will yield same result

    =COUNTIFS(A5:Q14,"John",B5:R14,5,C5:S14,5)

  5. #5
    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,146

    Re: count across multiple columns with multiple criteria

    What value you expect: the only true condition for Name=John & Sale=5 & Percentage=5 is 1 which is what Glenn's formula returns
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] Formula to count matches between multiple columns on different sheets w/ multiple criteria
    By RICK JAMES in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-05-2019, 03:28 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. Replies: 1
    Last Post: 02-09-2017, 05:55 PM
  4. Count w/multiple criteria across multiple columns - SUMPRODUCT, MATCH?
    By MrHoohah in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2015, 05:23 PM
  5. Count or Sum multiple columns when the criteria is met
    By sarinky in forum Excel General
    Replies: 5
    Last Post: 02-09-2012, 12:55 AM
  6. Count instances of a string across multiple columns with multiple criteria
    By rpthoth in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-01-2012, 09:23 AM
  7. Replies: 1
    Last Post: 09-03-2010, 12:52 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