Counting unique products from three columns

Status
Not open for further replies.

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
790
Office Version
  1. 365
Platform
  1. Windows
Slight repost because it was phrased poorly with bad examples, so hopefully this is clearer.

On the attached image I have Tour Dates in B, Campaign Name in C and Product Name in D.

What I am looking to do is find out for each Campaign Name, how many unique products exist. A unique product is one where the combination of Tour Date and Product Name is distinct.

Looking at the example image, there are 8 lines for Campaign "35. Irish Setter". However, there are two duplicate lines for Bournemouth Weekend - there are two products on the same date for the 6th and 13th November.

This means there are actually 6 unique products on the tour. The green highlighted column shows the expected result. I can get this result with the following formula:

Excel Formula:
=SUMPRODUCT((1/COUNTIFS($B$2:$B$9,$B$2:$B$9,$C$2:$C$9,$C$2:$C$9,$D$2:$D$9,$D$2:$D$9)))

However, this only works when the range exactly matches the number of lines for the corresponding campaign

What I would like to do is have this formula go down to the bottom of the range (Row 850) and have it count the products based on the campaign name in column C on the current row.


This should be possible I think I'm just missing the syntax to do so. Thank you!
 

Attachments

  • help2.PNG
    help2.PNG
    133.9 KB · Views: 12

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Duplicate Quickfire Formula - Count unique products
Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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