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
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)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks