Count entries ignoring multiple entries

rfdsc

New Member
Joined
Aug 8, 2011
Messages
8
Hi,

first time I post here, so let's see if I make myself clear.

I want to count the number of entries in a column associated to another column. At the same time I want to ignore multiple entries. Example:

Company Country MFS
bla Sweden Apples
bla Sweden Oranges
bla Sweden Potatos
bla Italy Apples
bla US Oranges

The formula I am using is:

=SUM(SUMPRODUCT(($B$2:$B$6=B2)*($C$2:$C$6="Sweden"));SUMPRODUCT(($B$2:$B$6=B2)*($C$2:$C$6="Italy"));SUMPRODUCT(($B$2:$B$6=B2)*($C$2:$C$6="US")))

Which retrieves the value 5 for company bla. What I want is the three Sweden entries to count as 1 and the result of the formula should be 3. I have tried with pivot tables and the result is the same.

Thank you in advance for your help.

Cheers,

/R
 
I meant yours worked :)

I didn't try this one, since I managed to use the one you sent.

Thanks

That's great. Thanks for providing feedback. In case you are (would become) curious about the "~"& and &"" bits, they are used to counteract the adverse effects of some chars like < around the entries in the target range. If you are confident that such does not occur, you can remove these bits from the formula.
 
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Eheheh, I have been trying to understand that from the start. Thanks for the explanation

/R
 
Upvote 0

Forum statistics

Threads
1,224,532
Messages
6,179,388
Members
452,908
Latest member
MTDelphis

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