Define range based on 3 conditions then count unique text

Nick70

Active Member
Joined
Aug 20, 2013
Messages
299
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a range (B4:E17).
In column B I have client name (e.g. client A, client B, etc.) , in column C I have product name (e.g. Product1, Product2" etc.), in column D I have month (Jan to Dec.), and in column E I have Year (2020, 2021 etc.).

I would like to have a formula (say in cell A2) which gives me the number of "unique" products which appear in column C based on 3 conditions: products have been bought by ClientA (in column B), bought in month of February(in column D), bought in year 2021(in column E).

When I say 'unique' products it means that if based on 3 conditions (clientA, February and 2021) we have these products in column C: Product1,Product1,Product2,Product3,Product3 then the formula should give back 3 (i.e. Product1,Product2,Product3).

Which formula or which method should I use?

Thanks,
Nic :unsure:
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
How about
Excel Formula:
=ROWS(UNIQUE(FILTER(C4:C17,(B4:B17="client a")*(D4:D17="February")*(E4:E17=2021))))
 
Upvote 0
Solution
Hi,

When I use this formula I get error message #CALC!

Any idea why?

:unsure:
 
Upvote 0
That suggests you don't have any data that matches all the criteria.
 
Upvote 0
You are right!!

I did not check that...

All good then thanks!
Nic :) (y)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

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