Reputation: 55
I have a workbook with multiple sheets. On sheet1 I would like to count the number of times person in column A has a particular entry in Column C that meets criteria of column D = Content but only count if column B is a unique value.
Using the below formula I can do everything except only counting unique numbers in Column B. I enter this formula in Sheet2 C2 then pull across to I2 then pull down to 6 in each column.
=IF(COUNTIFS(Sheet1!$A$2:$A$150,Sheet2!$B2,Sheet1!$C$2:$C$150,Sheet2!C$1,Sheet1!$D$2:$D$150,"Content")=0,"",COUNTIFS(Sheet1!$A$2:$A$150,Sheet2!$B2,Sheet1!$C$2:$C$150,Sheet2!C$1,Sheet1!$D$2:$D$150,"Content"))
I am using the double countifs to not show 0's.
Here is what it looks like for Sheet1
Here is how I would like Sheet 2 to look
Any help or advise would be much appreciated.
Upvotes: 0
Views: 4678
Reputation: 2066
The answer by Vijayakumar works. In case you need a simpler version (without the data model option, use this formula in column E dragged down
=SUMPRODUCT(--($B$1:B1=B2))>0
Col E
) to filter section and "QN" to Value section When you have new data, you just need to Change Data Source
from the Pivot Table tools
->Analyze
or Refresh. However you can record this whole process as macro to automate it.
Upvotes: 2
Reputation: 1145
You can achieve this via Pivot table.
In The Pivot table fields Move "SR" to Rows section "Stage" to column section "Prod" to filter section "QN" to Value section
Now right click on some cell in Pivot which shows sum/count of QN Summarize values by -> More optins
Note: Distinct count won't appear in values section if step 3 is missed out. Hope this helps.
Upvotes: 1