Formula to remove doubles in excel

vince1985

New Member
Joined
Sep 17, 2015
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
good morning,

I would like to submit an issue i am often facing on Excel.
I am uploading an example hereunder in order to illustrate my request.

I have a 2 entries table and i would like to depict, according to a specific criteria, each of its value only once, without using a pivot table nor vba

In the enclosed example there is a table where one line = one student. Students are in 3 classrooms. I would like to have a formulae showing, for each classroom (which is my criteria then), the different ages of its students (hence only depicting only once the ages that are in double in this classroom).
I have a formula that does the job without criteria. However, I do not know any formula working with a criteria.

Has anyone already faced this case before ?

thank you in advance for your support !
 

Attachments

  • 2022-11-25 08_22_03-Test - Excel.png
    2022-11-25 08_22_03-Test - Excel.png
    18.9 KB · Views: 13
I don't understand your expected results. How do you get a value of V for criteria A? Hopefully an error.
This is also a bit trickier if the criteria and the values can be the same. For now, I have assumed that they would be different. Post back if we have to cope with them being the same.

vince1985.xlsm
ABCDEFG
1CriteriavalueOutput
2AAAcriteriaABC
3ABBvaluesAAAAQQ
4ACCBBVVAA
5AAACCCCBB
6AAADDBBCC
7ADD SS 
8BAA   
9BVV   
10BCC   
11BBB   
12BSS   
13BSS   
14CQQ   
15CAA   
16CBB   
17CBB   
18CCC   
No dupes (3)
Cell Formulas
RangeFormula
E3:G18E3=IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($B$2:$B$18)/(($A$2:$A$18=E$2)*(ISNA(MATCH($B$2:$B$18,E$2:E2,0)))),1)),"")
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Many thanks for your feedback.
Yes, the value V in the expected results was an error on my side and should not have been displayed. The criteria and values would also always be different.
=> Hence, I think that the formula that you posted shall work for me. I will check that later today and get back to you.
Thank you again
 
Upvote 0
I do confirm this formula worked perfectly for me. It works also very well with numeric data (only difference being that these are not sorted).

It is also easy to run the same formula without criteria or with several criteria by removing/adding condition(s) : ($N$4:$N$20=R$4)

A huge thank you for your help Peter !
 
Upvote 0

Forum statistics

Threads
1,215,779
Messages
6,126,846
Members
449,343
Latest member
DEWS2031

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