+ Reply to Thread
Results 1 to 3 of 3

Thread: Counting data conditional on specific multiple column entries

  1. #1
    Registered User
    Join Date
    02-07-2010
    Location
    Cambridgeshire, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Counting data conditional on specific multiple column entries

    Hello,

    I've tried hard with Pivot tables, nested IF statements, CountIF etc. but just cannot work out how to count up some data I have in a table of 3 columns. Can anyone help?!

    Here's the problem:

    I have 3 columns of data as follows:
    Column A contains one of two entries: 'Fruit' or 'Veg'.
    Column B contains various entries, one of which is 'Tomato'.
    Column C contains numbers ranging from 1 to 10

    What I want to do is this:
    1. Count the number of rows with Fruit in Column A, but excluding any rows that have Tomato in Column B.
    2. As above, but for Veg in Column A.
    3. Count the number or rows with Tomato in Column B.
    4. Of the numbers arising from the above three questions, count the number of those numbers that have an entry >5 in Column C.

    All advice very welcome - thanks!
    Clara

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Counting data conditional on specific multiple column entries

    1. Count the number of rows with Fruit in Column A, but excluding any rows that have Tomato in Column B.

    =SUMPRODUCT(--($A$1:$A$100="Fruit"),--($B$1:$B100<>"Tomato"))

    2. As above, but for Veg in Column A.

    As above but changing ref. above from "Fruit" to "Veg"

    3. Count the number or rows with Tomato in Column B.

    =COUNTIF($B$1:$B$100,"Tomato")

    4. Of the numbers arising from the above three questions, count the number of those numbers that have an entry >5 in Column C.

    =COUNTIF($C$1:$C$100,">5")

    (above based on premise that results of 1,2 & 3 ensure all rows are included in final calculation)

  3. #3
    Registered User
    Join Date
    02-07-2010
    Location
    Cambridgeshire, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Counting data conditional on specific multiple column entries

    Thanks very much! That helped a lot. I had to work out a few other problems because the example I gave was a simplified version of my actual problem - eg I needed to use wildcards with SUMPRODUCT and ended up using ISNUMBER-SEARCH function, although I had thought -- should do it.

    Clara

+ 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.2.0