Unique Distinct List comparing the sum from two columns

pto160

Active Member
Joined
Feb 1, 2009
Messages
478
Office Version
  1. 365
Platform
  1. Windows
I have two lists. I want to get a unique distinct list by comparing the sums of the unique values in list 1 that don't match the sums of the unique values in list 2.
Is that possible?

Sheet1

BCD
2 List 1
3Cat10
4Cat10
5Dog20
6Dog10
7Dog10
8House5
9
10 List 2
11Cat10
12Cat10
13Dog10
14Dog10
15
16
17Answer is Dog and House.

<colgroup><col style="WIDTH: 30px; FONT-WEIGHT: bold"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
List 1
D-List
Cat
10
20
Dog
Cat
10
20
House
Dog
20
40
Dog
10
40
Dog
10
40
House
5
5
List 2
Cat
10
20
Cat
10
20
Dog
10
20
Dog
10
20

<TBODY>
</TBODY>

C3, copied down:
Rich (BB code):
=SUMIF($A$3:$A$8,$A3,$B$3:$B$8)

C11, copied down:
Rich (BB code):
=SUMIF($A$11:$A$14,$A11,$B$11:$B$14)

Define Ivec using Formulas | Name Manager as:
Rich (BB code):
=ROW(Sheet1!$A$3:$A$8)-ROW(Sheet1!$A$3)+1

E3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX($A$3:$A$8,SMALL(IF(FREQUENCY(IF($A$3:$A$8<>"",
  IF(1-ISNUMBER(MATCH($A$3:$A$8&"|"&$B$3:$B$8,
      $A$11:$A$14&"|"&$B$11:$B$14,0)),
  MATCH($A$3:$A$8,$A$3:$A$8,0))),Ivec),Ivec),ROWS(E$3:E3))),"")
 
Upvote 0
Thank you so much. I think it's probably a good idea to use the sum if in C3 and C11 and copy down, because it probably speeds up the operation more quickly than trying not to use sum if column to get the same result. Is that correct?
Why are we using the sum if in column c when it's not referenced in the formula in E3?
Is there any way to use this formula with advanced filter to achieve the same result, where dog and house will be filtered?
 
Upvote 0
Thank you so much. I think it's probably a good idea to use the sum if in C3 and C11 and copy down, because it probably speeds up the operation more quickly than trying not to use sum if column to get the same result. Is that correct?
Why are we using the sum if in column c when it's not referenced in the formula in E3?
Is there any way to use this formula with advanced filter to achieve the same result, where dog and house will be filtered?

E3 meant to include the C ranges...
Control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX($A$3:$A$8,SMALL(IF(FREQUENCY(IF($A$3:$A$8<>"",
   IF(1-ISNUMBER(MATCH($A$3:$A$8&"|"&$C$3:$C$8,
          $A$11:$A$14&"|"&$C$11:$C$14,0)),
  MATCH($A$3:$A$8,$A$3:$A$8,0))),Ivec),Ivec),ROWS(E$3:E3))),"")
 
Upvote 0
Thank you. Is there a way to use this formula with advanced filter to filter list A?
 
Upvote 0
I remember in one of your posts you had used isna(match....m) using advanced filter to figure out what's not in one list. It filtered the results very quickly.I'm just thinking that advanced filter would make this operation faster. I'm dealing with 6000 rows.
 
Upvote 0
I remember in one of your posts you had used isna(match....m) using advanced filter to figure out what's not in one list. It filtered the results very quickly.I'm just thinking that advanced filter would make this operation faster. I'm dealing with 6000 rows.

Perhaps something like below...


X1Z1Y1 X2Y2Z3
CatCat|2010 Cat10Cat|20 FALSE
CatCat|2010 Cat10Cat|20 X1Z1
DogDog|4020 Dog10Dog|20 DogDog|40
DogDog|4010 Dog10Dog|20 HouseHouse|5
DogDog|4010
HouseHouse|55

<COLGROUP><COL style="WIDTH: 48pt" width=64><COL style="WIDTH: 62pt; mso-width-source: userset; mso-width-alt: 2929" width=82><COL style="WIDTH: 48pt" width=64><COL style="WIDTH: 19pt; mso-width-source: userset; mso-width-alt: 881" width=25><COL style="WIDTH: 48pt" span=4 width=64><COL style="WIDTH: 68pt; mso-width-source: userset; mso-width-alt: 3214" width=90><COL style="WIDTH: 69pt; mso-width-source: userset; mso-width-alt: 3271" width=92><TBODY>
</TBODY>

B2, copied down:

=$A2&"|"&SUMIF($A$2:$A$7,$A2,$C$2:$C$7)

G2, copied down:

=$E2&"|"&SUMIF($E$2:$E$5,$E2,$F$2:$F$5)

Criteria range: I1:I2

I1 is left empty.

I2 houses:

=ISNA(MATCH(B2,$G$2:$G$5,0))

Run Advance Filter with:

Copy to another location checked
List range set to: $A$1:$B$7
Criteria range set to: $I$1:$I$2
Copy to is set as: $I$3

And the option for Unique records only checked.
 
Upvote 0
Thank you so much Aladin. Both solutions work great. I'll probably use the formula method more. I was surprised how fast it extracted the list. It's saving me a lot of time at work.
 
Upvote 0

Forum statistics

Threads
1,215,573
Messages
6,125,608
Members
449,238
Latest member
wcbyers

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