Extract unique records based on multiple critieria

MZING81

Board Regular
Joined
Mar 20, 2012
Messages
74
Hello Everyone,

I have this formula that works well for what I need it to do. Which is ignore duplicates, and extract unique records based on multiple ciriteria.

{=SUM(--(FREQUENCY(IF((EXTRACTED!$G$4:$G$3000=$B10)*(EXTRACTED!$H$4:$H$3000<>"")*(EXTRACTED!$I$4:$I$3000=$CP$8),MATCH(EXTRACTED!$D$4:$D$3000,EXTRACTED!$D$4:$D$3000,0)),ROW(INDIRECT("1:"&ROWS(EXTRACTED!$D$4:$D$3000))))>0))}

Here in lies the problem. I have this formula in a bout 400 plus cells, but because it has the INDIRECT portion the calculations get slowed down considerably. Is there anything that I can do to update the formula, to have it calculate faster, I'm willing to change the formula if needed.

-Thanks
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I actually miss spoke with the title it should be "counting/summing unique records in an array based on multiple criteria".
 
Upvote 0
That does deliver a multiconditional unique record count... I don't think you need INDIRECT...

Rich (BB code):
=SUM(IF(FREQUENCY(
   IF(EXTRACTED!$D$4:$D$3000<>"",
   IF(EXTRACTED!$H$4:$H$3000<>"",
   IF(EXTRACTED!$G$4:$G$3000=$B10,
   IF(EXTRACTED!$I$4:$I$3000=$CP$8,
   MATCH(EXTRACTED!$D$4:$D$3000,EXTRACTED!$D$4:$D$3000,0))))),
   ROW(EXTRACTED!$D$4:$D$3000)-ROW(EXTRACTED!$D$4)+1),1))

Define Ivec (from integer vector) as referring to:
Rich (BB code):
=ROW(EXTRACTED!$D$4:$D$3000)-ROW(EXTRACTED!$D$4)+1

We can re-write the formula now as:
Rich (BB code):
=SUM(IF(FREQUENCY(
  IF(EXTRACTED!$D$4:$D$3000<>"",
  IF(EXTRACTED!$H$4:$H$3000<>"",
  IF(EXTRACTED!$G$4:$G$3000=$B10,
  IF(EXTRACTED!$I$4:$I$3000=$CP$8,
  MATCH(EXTRACTED!$D$4:$D$3000,EXTRACTED!$D$4:$D$3000,0))))),
  Ivec),1))

Concatenating a bit...

J2, copied down:
Rich (BB code):
=D4&H4

We can do another re-write...
Rich (BB code):
=SUM(IF(FREQUENCY(
  IF(EXTRACTED!$J$4:$J$3000<>"",
  IF(EXTRACTED!$G$4:$G$3000=$B10,
  IF(EXTRACTED!$I$4:$I$3000=$CP$8,
  MATCH(EXTRACTED!$D$4:$D$3000,EXTRACTED!$D$4:$D$3000,0))))),
  Ivec),1))
 
Last edited:
Upvote 0
That does deliver a multiconditional unique record count... I don't think you need INDIRECT...

Rich (BB code):
=SUM(IF(FREQUENCY(
   IF(EXTRACTED!$D$4:$D$3000<>"",
   IF(EXTRACTED!$H$4:$H$3000<>"",
   IF(EXTRACTED!$G$4:$G$3000=$B10,
   IF(EXTRACTED!$I$4:$I$3000=$CP$8,
   MATCH(EXTRACTED!$D$4:$D$3000,EXTRACTED!$D$4:$D$3000,0))))),
   ROW(EXTRACTED!$D$4:$D$3000)-ROW(EXTRACTED!$D$4)+1),1))

Define Ivec (from integer vector) as referring to:
Rich (BB code):
=ROW(EXTRACTED!$D$4:$D$3000)-ROW(EXTRACTED!$D$4)+1

We can re-write the formula now as:
Rich (BB code):
=SUM(IF(FREQUENCY(
  IF(EXTRACTED!$D$4:$D$3000<>"",
  IF(EXTRACTED!$H$4:$H$3000<>"",
  IF(EXTRACTED!$G$4:$G$3000=$B10,
  IF(EXTRACTED!$I$4:$I$3000=$CP$8,
  MATCH(EXTRACTED!$D$4:$D$3000,EXTRACTED!$D$4:$D$3000,0))))),
  Ivec),1))

Concatenating a bit...

J2, copied down:
Rich (BB code):
=D4&H4

We can do another re-write...
Rich (BB code):
=SUM(IF(FREQUENCY(
  IF(EXTRACTED!$J$4:$J$3000<>"",
  IF(EXTRACTED!$G$4:$G$3000=$B10,
  IF(EXTRACTED!$I$4:$I$3000=$CP$8,
  MATCH(EXTRACTED!$D$4:$D$3000,EXTRACTED!$D$4:$D$3000,0))))),
  Ivec),1))

thank you for the help I'll give it a try!!!
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

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