Counting unique values - based on another column!
-
so here's the data: column A contains a drop-down list of three text values (Apple, Pear, Orange). column B contains names - some of which may be repeated. what i would like to do is count the number of unique values in column B for EACH of the values in column A - leaving me with three unique sums. For example, there are three occurrences of the same name in column B where Appeal has been chosen in column A. I only want to count that name once. Does my question make sense? I found tons of formulae online about counting unique text values, but none about counting unique text values BASED ON text values in another column ... Thanks in advance! :) Sandy
-
Answer:
Sandy, Say the data with Apple, Pear, Orange are located in A2:A22 the data with the values to count uniques are located in B2:B22 for Apples: =SUM(IF(FREQUENCY(IF((LEN($B$2:$B$22)>0)*($A$2:$A$22="Apple"),MATCH($B$2:$B$22,$B$2:$B$22,0),""), IF((LEN($B$2:$B$22)>0)*($A$2:$A$22="Apple"),MATCH($B$2:$B$22,$B$2:$B$22,0),""))>0,1)) for Pears: =SUM(IF(FREQUENCY(IF((LEN($B$2:$B$22)>0)*($A$2:$A$22="Pear"),MATCH($B$2:$B$22,$B$2:$B$22,0),""), IF((LEN($B$2:$B$22)>0)*($A$2:$A$22="Pear"),MATCH($B$2:$B$22,$B$2:$B$22,0),""))>0,1)) for Oranges: =SUM(IF(FREQUENCY(IF((LEN($B$2:$B$22)>0)*($A$2:$A$22="Orange"),MATCH($B$2:$B$22,$B$2:$B$22,0),""), IF((LEN($B$2:$B$22)>0)*($A$2:$A$22="Orange"),MATCH($B$2:$B$22,$B$2:$B$22,0),""))>0,1)) each of these need to be entered with Ctrl+Shift+Enter (hold down the control and shift keys while you hit Enter) rather than just enter since these are Array formulas. Is that what you want. The above were tested under the stated assumptions and they worked for me.
Miningco.com Visit the source
Related Q & A:
- How to split column text to another column?Best solution by Stack Overflow
- How to find the column name of the first column with a null value?Best solution by Stack Overflow
- How to change column data's as a separate column wise format in a SQL Server?Best solution by stackoverflow.com
- How can display multiple values to single column?Best solution by Stack Overflow
- What are a few unique Chinese values?Best solution by lotustours.net
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.