Formula to show in 4 columns the letters from one column with condition

Fractalis

Active Member
Joined
Oct 11, 2011
Messages
328
Office Version
  1. 365
Platform
  1. Windows
I have a input table like this A1:C21. I'm trying to show (in 4 columns array) the "Letters" that meet the condition
in J2 and K2. In this example I'm getting the letters for which Col_A = 1 and Col_B = "MM".

Below I'm showing the current output using a formula in E2 (borrowed from here), but when I copy across and down, repeats letters
and the letters are shown separated. I'd like to get the letters without separation in 4 columns and needed rows by each case.
Maybe some SPILL function could calculate dinamycally the rows without repetition.

Thanks in advance for any help.


file.xlsx
ABCDEFGHIJKL
1VALUESTYPELETTERSCURRENT OUTPUTVALUETYPE
21MMAA    1MM
33MMB   N
41ASC  K  
52MMD H   
62ASE     
73ASF  N  
83ASG K S
91MMH
102ASIEXPECTED OUTPUT
112MMJAHKN
121MMKS
131ASL
143ASM
151MMN
163MMO
171ASP
182ASQ
193ASR
201MMS
211AST
Sheet1
Cell Formulas
RangeFormula
E2:H8E2=UNIQUE(INDEX(IF(($A$2:$A$21=$J$2)*($B$2:$B$21=$K$2),$C$2:$C$21,""),ROWS($A$1:A1)+(COLUMNS($A$1:A1)-1)*4))
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try this in E11:

Excel Formula:
=IFERROR(INDEX(UNIQUE(FILTER(C2:C21,(A2:A21=J2)*(B2:B21=K2))),SEQUENCE(6,4)),"")

Clear out the existing data first.
 
Upvote 1
Try this in E11:

Excel Formula:
=IFERROR(INDEX(UNIQUE(FILTER(C2:C21,(A2:A21=J2)*(B2:B21=K2))),SEQUENCE(6,4)),"")

Clear out the existing data first.
Hi @Eric W I can only laugh that I racked my brain for more than 2 hours on how to do it and it took me longer to write the question than it took you to respond with a solution hahaha :). Thanks, thanks, thanks
 
Upvote 0
Another option.
Book1
ABCDEFGHIJK
1VALUESTYPELETTERSCURRENT OUTPUTVALUETYPE
21MMA 1MM
33MMB
41ASC 
52MMD 
62ASE 
73ASF 
83ASG
91MMH
102ASIEXPECTED OUTPUT
112MMJAHKN
121MMKS
131ASL
143ASM
151MMN
163MMO
171ASP
182ASQ
193ASR
201MMS
211AST
Sheet7
Cell Formulas
RangeFormula
I2,I4:I7I2=INDEX(IF(($A$2:$A$21=1)*($B$2:$B$21="MM"),$C$2:$C$21,""),ROWS($A$1:E1)+(COLUMNS($A$1:E1)-1)*3)
E11:H12E11=WRAPROWS(FILTER(C2:C21,(A2:A21=J2)*(B2:B21=K2)),4,"")
Dynamic array formulas.
 
Upvote 0
You can add UNIQUE().
Excel Formula:
=WRAPROWS(UNIQUE(FILTER(C2:C21,(A2:A21=J2)*(B2:B21=K2))),4,"")
 
Upvote 0
Solution
You can add UNIQUE().
Excel Formula:
=WRAPROWS(UNIQUE(FILTER(C2:C21,(A2:A21=J2)*(B2:B21=K2))),4,"")
Thank you, it works! without know too much about this, I changed to yours as the solution due that is shorter.
 
Upvote 0

Forum statistics

Threads
1,224,885
Messages
6,181,586
Members
453,055
Latest member
cope7895

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