+ Reply to Thread
Results 1 to 9 of 9

Count Matching Cells

  1. #1
    Registered User
    Join Date
    06-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    74

    Count Matching Cells

    In colums G & K, I have an array of cities.

    I need a formula that counts how many times G & K match as long as there is a value in column A.

    So when both cities are the same the formula should count. The reason I need to to correspond to whether or not there is a value in A, is because if the value in Column A is blank, I do not need it to count any matches in G & K.

  2. #2
    Registered User
    Join Date
    07-31-2012
    Location
    cape cod
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Count Matching Cells

    can you upload the spreadsheet? Count if should work.

  3. #3
    Registered User
    Join Date
    06-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    74

    Re: Count Matching Cells

    I don't know how to upload spreadsheets on here

    I've tried using countif with no luck, probably doing it wrong

  4. #4
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Count Matching Cells

    Try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  5. #5
    Registered User
    Join Date
    06-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    74

    Re: Count Matching Cells

    BINGO

    Thanks Søren Larsen

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count Matching Cells

    Try:

    =Sumproduct(--(G1:G100=K1:K100),--(A1:A100<>""))

    ajust range to suit.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  7. #7
    Registered User
    Join Date
    06-13-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    74

    Re: Count Matching Cells

    That worked as well, thanks NBVC

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count Matching Cells

    Note that with Sumproduct it is not recommended to use whole column references... for efficiency sake.... it will be processing cells needlessly....

  9. #9
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Count Matching Cells

    If all is sorted, then don't forget to mark your 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)

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