Need a function

SB

New Member
Joined
Mar 20, 2002
Messages
18
Can anyone help me come up with a function that will:

Scan a list of names and count how many of the names have a corresponding "yes" value beside them. However, if the name is listed twice, the function should ignore the redundant listings. Therefore only counting a recurring name the first time.

The data would be in two columns, say A1:B10.
With names in Coulmn A and "Yes" or "No" in column B.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi SB
Same message I sent to the last guy.
Someone will probably give you a nice formula. If not this would be easy to accomplish with VBA.
I'll post a small macro if no one helps you out.
Tom
 
Upvote 0
Approaches include the following:

1. Use a Pivot Table and hide the Grand total.

2. Use =COUNTIF($A$2:A2,A2) copy down
recap the count of column
and "Yes" criteria with Sumproduct

3. Concatenate 2 columns and evaluate the number that are unique

- =A2&|&B2
number unique with Array Formula
=SUM(1/COUNTIF(rA,rA))

rA is name of range of concatenated info
Enter the Array formula with Ctrl-Shift-Enter
This message was edited by Dave Patton on 2002-03-26 13:41
 
Upvote 0
Thanks for the formula but I am having trouble understanding it. I can't get it to work.
 
Upvote 0
Which approach did You decide to try?

There are pros and cons to each solution.
 
Upvote 0
You can use Data Filter Advanced to
give you a list thaat meet your criteria.

Use Counta to count the names in the list.

It is Your choice what approach you want to use.
 
Upvote 0
On 2002-03-26 13:02, Dave Patton wrote:
Approaches include the following:

1. Use a Pivot Table and hide the Grand total.

2. Use =COUNTIF($A$2:A2,A2) copy down
recap the count of column
and "Yes" criteria with Sumproduct

3. Concatenate 2 columns and evaluate the number that are unique

- =A2&|&B2
number unique with Array Formula
=SUM(1/COUNTIF(rA,rA))

rA is name of range of concatenated info
Enter the Array formula with Ctrl-Shift-Enter
This message was edited by Dave Patton on 2002-03-26 13:41

Sumproduct won't work with names. I suggest the pivot table approach.

-rh
 
Upvote 0
Russell

You stated
" Sumproduct won't work with names. "

Would you clarify?
 
Upvote 0
My 2 cents:

All of the suggestions by Dave Patton, including Adv Filter combined with COUNTA would work.

Another approach that would not require an additional column that concatenates the data from 2 columns is what follows.

lets consider the sample in A4:B9.

{"Name","Y/N";
"ali","yes";
"jon","no";
"jon","yes";
"dan","yes";
"ali","yes"}

Try:

=SUM(IF(FREQUENCY(MATCH(A5:A9&B5:B9,A5:A9&B5:B9,0),MATCH(A5:A9&B5:B9,A5:A9&B5:B9,0))=1,1))

normally entered.

Aladin
 
Upvote 0
Thanks very much Aladin.

That is quite the formula.

I was close but I could not get all the pieces to connect.
 
Upvote 0

Forum statistics

Threads
1,213,526
Messages
6,114,122
Members
448,550
Latest member
CAT RG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top