+ Reply to Thread
Results 1 to 8 of 8

count numbers that match

  1. #1
    Registered User
    Join Date
    06-02-2010
    Location
    n.ireland
    MS-Off Ver
    Excel 2007
    Posts
    91

    count numbers that match

    Hello all,

    I have a w/book were i need to count numbers that match a team.
    ei i want G4 to show 2,because column C team a matches column B number 4 twice.
    Please if anyone can help,see attached w/book.Thanks
    Attached Files Attached Files
    Last edited by dealer; 10-08-2010 at 03:09 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: count numbers that match

    Given use of XL2007

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-02-2010
    Location
    n.ireland
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: count numbers that match

    Thank you,it does the trick.
    But for my peace of mind could this be done with a combination of sumif & countif or would i be way off the mark.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,037

    Re: count numbers that match

    You can try this formula.. SUMIF won't work here:

    =SUMPRODUCT(--($C$2:$C$11=$E4),--($B$2:$B$11=F$3))

    but COUNTIFS is better approach.
    Never use Merged Cells in Excel

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: count numbers that match

    Quote Originally Posted by dealer
    for my peace of mind could this be done with a combination of sumif & countif
    I'm afraid not at least not in present form.

    SUMIF & COUNTIF are both constrained in so far as

    a) they process on the basis of a single criteria (you have two) [COUNTIFS & SUMPRODUCT can handle multiple criteria]

    b) they are not able to adjust the underlying values within the calculation (unlike SUMPRODUCT)
    If you wanted to use COUNTIF you would need to concatenate B & C in to a new column, eg:

    Please Login or Register  to view this content.
    At which point:

    Please Login or Register  to view this content.
    As mentioned you could avoid the concatenation and COUNTIFS and use SUMPRODUCT, however, SUMPRODUCT is inefficient.

    If you can use COUNTIFS you should do so.
    If you can't (backwards compatibility) I would advise the concatenation approach.

    Implementing Matrices of SUMPRODUCTs is generally speaking a bad habit to get into - if you search the board for "Poor Performance" threads you'll get the idea
    As such I rarely advise it.

  6. #6
    Registered User
    Join Date
    06-02-2010
    Location
    n.ireland
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: count numbers that match

    Thanking you both for the replies.

    Please don't pick me up wrong,i am using your countifs formula.
    i spent 30 mins trying to use sumif,countif.
    and as you pointed out i was taking the wrong approach,i am just trying to understand how different functions work.
    if i was to use excel 2003 what then would the right approach be?
    since countifs is 2007.use sumproduct then?

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,037

    Re: count numbers that match

    Yes.
    SUMPRODUCT for pre-2007 versions if you don't want extra helper column.

    If your workbook is small you can use SUMPRODUCT.
    If it's large it will become slow so Donkeyote's approach with helper column is much faster.

    Also, you can use a Pivot table.

  8. #8
    Registered User
    Join Date
    06-02-2010
    Location
    n.ireland
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: count numbers that match

    Thanks again,problem solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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