Is there a formula to calculate the number of rows with two unique values and one specified criteria?

quicklyman

New Member
Joined
Jul 9, 2017
Messages
1
I have a situation where I import raw data for training course attendance, but need to establish the number of unique users from a specified department, who attended the courses that took place during the reporting period:

For example,

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]HR[/TD]
[TD]John Smith[/TD]
[TD]MS Word Demo[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Warehouse[/TD]
[TD]Fred Bloggs[/TD]
[TD]MS Excel Demo[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Mailroom[/TD]
[TD]Jane Jones[/TD]
[TD]MS Powerpoint Demo[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Finance[/TD]
[TD]Dave Williams[/TD]
[TD]MS Word Demo[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Warehouse[/TD]
[TD]John Smith[/TD]
[TD]MS Word Demo[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Finance[/TD]
[TD]Jane Jones[/TD]
[TD]MS Excel Demo[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Warehouse[/TD]
[TD]Fred Bloggs[/TD]
[TD]MS Excel Demo[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Each time I obtain the data I don't know from what videos (column C) will have been viewed, and I don't know what people (column B) would have viewed them. I need to calculate how many people from a specified department (column A) viewed each video, and to ignore any people that viewed the same video twice. So in the above example, if I specified "Warehouse" in the formula, I'd need to get a result of "2" (because Fred Bloggs from the Warehouse viewed the MS Excel Demo, and John Smith from the Warehouse viewed the MS Word Demo. Fred Blogg's additional visit to the MS Excel Demo video shouldn't be counted).

Is there a way to do this via a formula rather than a pivot? It means I can just dump the data in each month and get the stats I and my team need).

Essentially I'm trying to ascertain how many unique visitors from a specified department are visiting each different video ( without the popularity of the video being falsely exaggerated by counting multiple visits by the same person).

Any help appreciated!
 

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
Probably start with a helper column (column D?) to ID the duplicates using =countif($A$1:A1,A1) copied down

Then create a table with departments and use COUNTIFs() to run your count, using D = 1
 
Upvote 0
Another way.


Excel 2012
ABCDEF
11HRJohn SmithMS Word DemoHR1
22WarehouseFred BloggsMS Excel DemoWarehouse2
33MailroomJane JonesMS Powerpoint DemoMailroom1
44FinanceDave WilliamsMS Word DemoFinance2
55WarehouseJohn SmithMS Word Demo
66FinanceJane JonesMS Excel Demo
77WarehouseFred BloggsMS Excel Demo
88
Sheet1
Cell Formulas
RangeFormula
F1=SUMPRODUCT(($B$1:$B$7=E1)/COUNTIFS($B$1:$B$7,$B$1:$B$7,$C$1:$C$7,$C$1:$C$7,$D$1:$D$7,$D$1:$D$7))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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