Count if without duplicates and other values

CarlCarlos

New Member
Joined
Jan 12, 2011
Messages
31
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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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.
 
Upvote 0
Wow a very impressive formula. It works spot on so thank you, but could you please explain how this does what it does?
 
Upvote 0

Forum statistics

Threads
1,225,530
Messages
6,185,479
Members
453,297
Latest member
alvintranvcu123

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