Count unique values based on two conditions

thomasuponor

New Member
Joined
Sep 13, 2018
Messages
44
Office Version
  1. 2016
Platform
  1. Windows
I am looking for a way to count unique values in column E based on column M = "Installer/contractor" AND column O = {"A1";"A2";"A3";"B1"B2"}

Currently my formula is: (it only includes column M)

=SUM(--(FREQUENCY(IF('Visit Data'!$M:$M="Installer/Contractor";MATCH('Visit Data'!$E:$E;'Visit Data'!$E:$E;0));ROW('Visit Data'!$E:$E)-ROW('Visit Data'!$E$3)+1)>0))

1.PNG
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
How about:

=SUM(--(FREQUENCY(IF(('Visit Data'!$M3:$M200="Installer/Contractor")*(ISNUMBER(SEARCH("|" &'Visit Data'!O3:O200&"|","|A1|A2|A3|B1|B2|"))),MATCH('Visit Data'!$E3:$E200,'Visit Data'!$E3:$E200,0)),ROW('Visit Data'!$E3:$E200)-ROW('Visit Data'!$E$3)+1)>0))

I suggest you limit the range of cells, because it is an array formula and consumes many resources.
 
Upvote 0
How about:

=SUM(--(FREQUENCY(IF(('Visit Data'!$M3:$M200="Installer/Contractor")*(ISNUMBER(SEARCH("|" &'Visit Data'!O3:O200&"|","|A1|A2|A3|B1|B2|"))),MATCH('Visit Data'!$E3:$E200,'Visit Data'!$E3:$E200,0)),ROW('Visit Data'!$E3:$E200)-ROW('Visit Data'!$E$3)+1)>0))

I suggest you limit the range of cells, because it is an array formula and consumes many resources.
This is really cool. Works without problems. Thanks!
 
Upvote 0
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version.
@thomasuponor
It is a pity that didn't happen as this much shorter formula works for me and would for you too if you had an appropriate Excel version. Without knowing your version, I don't know if this post is a waste of time or not. ;)

=ROWS(UNIQUE(FILTER('Visit Data'!E3:E200,('Visit Data'!M3:M200="Installer/Contractor")*(ISNUMBER(SEARCH("|" &'Visit Data'!O3:O200&"|","|A1|A2|A3|B1|B2|"))))))
 
Upvote 0
@thomasuponor
It is a pity that didn't happen as this much shorter formula works for me and would for you too if you had an appropriate Excel version. Without knowing your version, I don't know if this post is a waste of time or not. ;)

=ROWS(UNIQUE(FILTER('Visit Data'!E3:E200,('Visit Data'!M3:M200="Installer/Contractor")*(ISNUMBER(SEARCH("|" &'Visit Data'!O3:O200&"|","|A1|A2|A3|B1|B2|"))))))
@Peter_SSs Let me try this one again. And let me also update my Excel information (Y) cheers and best
 
Upvote 0
@Peter_SSs Let me try this one again. And let me also update my Excel information (Y) cheers and best
Cheers. Interested to see how this goes for you if you have Excel 365 with the FILTER & UNIQUE functions.
In any case looking forward to your Excel version info in your profile. ;)
BTW, you need a lower case y to get (y)
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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