Count if without duplicates and other values

CarlCarlos

New Member
Hi all,

I am looking to pull together a spreadsheet that counts up the number of products that I have if they have sales e.g.

PRODUCT Year 1 Sales Year 2 Sales
A 50
A 0
B 20
C 12
D 0
D 16
E 0

As you can see I have the same product duplicated which may or may not have sales. What I need is a count if that counts the number of products that had sales in the year. in this example it would be 4 products.

While I have managed to make a count if that removes duplicates, I am unable to make this exclude duplicates AND no sales values.

Can you please help?

Kindest Regards
Carl Carlos

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Example:

Excel 2010
ABC
1PRODUCTSALES4
2A50
3A0
4B20
5C12
6D0
7D16
8E0
Sheet1
Cell Formulas
RangeFormula
C1{=SUM(IF(FREQUENCY(IF(B2:B8<>0,MATCH(A2:A8,A2:A8,0)),ROW(A2:A8)-ROW(A2)+1),1))}
Press CTRL+SHIFT+ENTER to enter array formulas.

Wow a very impressive formula. It works spot on so thank you, but could you please explain how this does what it does?

Use the Evaluate Formula tool to see how it works.

Replies
0
Views
139
Replies
7
Views
213
Replies
3
Views
72
Replies
1
Views
155
Replies
1
Views
119

Threads
1,203,531
Messages
6,055,939
Members
444,838
Latest member
Eng76

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

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