UNIQUE(FILTER) - MULTIPLE INCLUDE

garypea123

Board Regular
Joined
Mar 16, 2020
Messages
223
Office Version
  1. 365
Platform
  1. Windows
Good Morning Genius's

Apologies as I cannot download XLSBB

I am having a little issue with my unique filter as I would like to include two columns.

My formula in H3 is =UNIQUE(FILTER(C3:C57,(B3:B57=F3)+(D3:D57=G3)))

However, as you can see there is no JOHN SMITH who has PART 2. However the formula is saying he does.



MULTIPLE UNIQUE FILTER.JPG



FIRST NAMEDESCRIPTIONSURNAMEFIRST NAMESURNAMEDESCRIPTION
JOHNPART 1SMITHJOHNSMITHPART 1
JOHNPART 1SMITHPART 2
JOHNPART 1SMITHPART 4
PHILPART 2JONES
KEVINPART 2SMITH
PHILPART 3JONES
KEVINPART 3PHILLPS
JOHNPART 4SMITH
JOHNPART 4SMITH
JOHNPART 4SMITH
JOHNPART 4SMITH
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Sussed it out
I would be wary of concatenating values directly like that - see example below in col H (may be unlikely names but shows what can happen with direct concatenation)
I have shown two safer alternatives. I would use the col I one.

24 02 20.xlsm
BCDEFGHIJ
1
2FIRST NAMEDESCRIPTIONSURNAMEFIRST NAMESURNAMEDESCRIPTIONDESCRIPTIONDESCRIPTION
3JOPART 1ETONJOETONPART 1PART 1PART 1
4JOEPART 3TONPART 3
5JOHNPART 1SMITH
6
Sample
Cell Formulas
RangeFormula
H3:H4H3=UNIQUE(FILTER(C3:C57,(B3:B57&D3:D57=F3&G3)))
I3I3=UNIQUE(FILTER(C3:C57,(B3:B57=F3)*(D3:D57=G3)))
J3J3=UNIQUE(FILTER(C3:C57,(B3:B57&"|"&D3:D57=F3&"|"&G3)))
Dynamic array formulas.
 
Upvote 0
Solution
Hi Peter - Thank you for your explanation.

I always forget about the * in the formula. If I had used that instead of the + then it would have been perfect (and more safe)

Great response though easily understood.
 
Upvote 0
You're welcome. Thanks for the follow-up. (y)

Yes, use * for AND conditions, + for OR conditions. You needed AND for this job. :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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