+ Reply to Thread
Results 1 to 2 of 2

Countifs with multiple criteria in a single range

  1. #1
    Registered User
    Join Date
    02-27-2012
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2010
    Posts
    1

    Countifs with multiple criteria in a single range

    Say I have a table with the following data:

    Column A Description Column B Description

    Apples Apples
    Apples Bananas
    Bananas Oranges
    Bananas Apples
    Apples Bananas
    Oranges Oranges
    Bananas Apples

    I'm trying to create a Countifs function that counts how many times each description in both columns occurs, but if the description occurs both in column A and column B in the same row, I only want to count it once. For example, in the first row apple appears both in column A and B. I only want to count apple once for that row. If a row contains, for example, Bananas and Oranges, then I want to count one banana and one orange.

    I have tried the following formulas =COUNTIFS('Column A Description'!A$1:AH$5000,Analysis!C25)+COUNTIFS('Column B Description'!B$!:B$5000,Analysis!C25,'Column B'!B$1:B$5000,"<>"&'Column A Description'!A$1:A$5000)

    and

    =COUNTIFS('Column A Description'!A$1:A$5000,Analysis!C24)+COUNTIFS('Column B Description'!A$1:A$5000,Analysis!C24)-COUNTIF('Column B Description'!B$1:B$5000,"=A$1:A$5000")

    The reference to C24 is a listing to a certain description out of a list of descriptions in a separate table. The first formula didn't work because it has multiple criterion for one range. The second formula didn't work because it counts blacks in the final countif.

    Does anyone have any suggestions?
    Last edited by Wolfpackfan320; 02-27-2012 at 05:20 PM.

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

    Re: Countifs with multiple criteria in a single range

    If your list is in A2:B8, and you have a list of the unique entries starting in say G2, then try:

    =COUNTIF($A$2:$A$8,G2)+COUNTIFS($B$2:$B$8,G2,$A$2:$A$8,"<>"&G2)

    copied down.
    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.

+ 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