+ Reply to Thread
Results 1 to 9 of 9

counting the number of occurrances of several numbers (say 2, 4, and 6) in three columns

  1. #1
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Dunedin, New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    105

    counting the number of occurrances of several numbers (say 2, 4, and 6) in three columns

    Hi

    I have three columns that contain numbers ranging from 1 to 10.

    I wish to count the number of times say 2, 4 and 6 occur in each of the three columns and come up with a total

    i.e. count # of times 2, 4 and 6 occur in all three columns

    I tried SUMPRODUCT but keep getting zero

    =SUMPRODUCT (--($A$2:$A$40=2)--($B$2:$B$40=2)--($C$2:$C$40=2)) and repeat for 4 and 6

    Any suggestions ?

    Bob M

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: counting the number of occurrances of several numbers (say 2, 4, and 6) in three colu

    I think you forgot about *
    =SUMPRODUCT (--($A$2:$A$40=2)*--($B$2:$B$40=2)*--($C$2:$C$40=2)) or
    =SUMPRODUCT (--($A$2:$A$40=2),--($B$2:$B$40=2),--($C$2:$C$40=2)) and so on... (no example - not tested)
    Last edited by sandy666; 12-04-2017 at 07:43 PM.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: counting the number of occurrances of several numbers (say 2, 4, and 6) in three colu

    Hi,

    One way

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Dunedin, New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    105

    Re: counting the number of occurrances of several numbers (say 2, 4, and 6) in three colu

    Hello Richard

    Yes - that will work - I guess I was hoping that SUMPRODUCT would be a little shorter in length

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: counting the number of occurrances of several numbers (say 2, 4, and 6) in three colu

    =sumproduct(COUNTIF(A2:C40, {2,3,4})
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Dunedin, New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    105

    Re: counting the number of occurrances of several numbers (say 2, 4, and 6) in three colu

    Hi shg

    brilliant - that's what I was seeking.................

    Now, one last tweek

    What if the 3 columns were not A, B & C but A, E and G?

    Bob M

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,532

    Re: counting the number of occurrances of several numbers (say 2, 4, and 6) in three colu

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  8. #8
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: counting the number of occurrances of several numbers (say 2, 4, and 6) in three colu

    Try:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,913

    Re: counting the number of occurrances of several numbers (say 2, 4, and 6) in three colu

    Try =SUMPRODUCT(COUNTIFS(OFFSET(A2:A40,,{0,4,6}),{2;3;4}))
    Please Login or Register  to view this content.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

+ 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. Count number of non-numerical occurrances
    By doublevee in forum Excel General
    Replies: 1
    Last Post: 10-14-2015, 03:08 PM
  2. Counting Occurrances based on Two Conditions
    By rclewis51 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-20-2009, 06:33 PM
  3. Counting Date Occurrances
    By Sandgroper in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-14-2008, 09:15 AM
  4. Counting occurrances of text in a column
    By jazzper in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-25-2008, 03:14 PM
  5. Excel 2000 Counting occurrances
    By Paul in forum Excel General
    Replies: 3
    Last Post: 08-02-2006, 01:55 PM
  6. Counting occurrances
    By Brad in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-18-2006, 03:20 PM
  7. Count and Sum Total occurrances of two specific numbers
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-29-2005, 04:06 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