Put multiple rows from FILTER horizontally on the same row

christian79

New Member
Joined
Oct 24, 2022
Messages
9
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi all,

I am trying to get Excel to put results from the FILTER function on the same row as my query, as illustrated below:

Lookup table:

IDDATECONTENTDATECONTENT
1Text1Text2Text3Text4
1Text5Text6
2Text7Text8Text9Text10
2Text11Text12
2Text13Text14

Analysis table wanted result:

ID
1Text1Text2Text3Text4Text5Text6
2Text7Text8Text9Text10Text11Text12Text13Text14

Using FILTER returns the rows, but since this is a continuous list I get overflows when there are two or more matches. Is there a way to put the data horizontally, as in the example above?

Thankful for any tips/help.

Best regards,
Christian
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What is the filter formula you currently have?
 
Upvote 0
It's just a very simple filter formula, like the one below.

=FILTER(SHEETNAME!$B$2:$G$100;SHEETNAME!$A$2:$A100=A1;"NOT FOUND")
 
Upvote 0
Thanks for that, how about
Excel Formula:
=TOROW(FILTER(SHEETNAME!$B$2:$G$100;SHEETNAME!$A$2:$A100=A1;"NOT FOUND"),1)
 
Upvote 0
Thanks for that, how about
Excel Formula:
=TOROW(FILTER(SHEETNAME!$B$2:$G$100;SHEETNAME!$A$2:$A100=A1;"NOT FOUND"),1)

Yeah, thought about that one, but the translated formula names are complicating things. I have the Swedish language Office version, and can't find the translated version of that function (even though I'm on 365). My customer seems to enforce this language version as a company policy, but even so I'd imagine all functions to be available?
 
Upvote 0
I don't have all the latest 365 functions that make this easier. And I started tinkering before you put up your sample. But maybe some of this could be of use.
MrExcelPlayground14.xlsx
ABCDEFGHIJKLMNOPQ
1IDDATECONTENTDATECONTENT
21Text1Text2Text3Text41Text1Text2Text3Text4Text5Text6
31Text5Text62Text7Text8Text9Text10Text11Text12Text13Text14
42Text7Text8Text9Text10
52Text11Text12
62Text13Text14
Sheet1
Cell Formulas
RangeFormula
G2:G3G2=UNIQUE(A2:A6)
H2:M2,H3:O3H2=LET(a,FILTER($B$2:$E$6,$A$2:$A$6=G2),b,4*ROWS(a),c,INDEX(a,((SEQUENCE(1,b)-1)/4)+1,MOD(SEQUENCE(1,b)-1,4)+1),d,SUM(--(c<>0)),e,(c<>0)*SEQUENCE(1,b),f,SORT(TRANSPOSE(e)),g,INDEX(f,SEQUENCE(d,1,ROWS(f)-d+1)),TRANSPOSE(INDEX(c,1,g)))
Dynamic array formulas.
 
Upvote 0
No idea what TOCOL is in Swedish, but another option is
Excel Formula:
=LET(f,FILTER(Sheetname!$B$2:$G$100,Sheetname!$A$2:$A100=A2,"NOT FOUND"),s,SEQUENCE(,ROWS(f)*6,0),INDEX(f,INT(s/6)+1,MOD(s,6)+1))
 
Upvote 0
Solution
No idea what TOCOL is in Swedish, but another option is
Excel Formula:
=LET(f,FILTER(Sheetname!$B$2:$G$100,Sheetname!$A$2:$A100=A2,"NOT FOUND"),s,SEQUENCE(,ROWS(f)*6,0),INDEX(f,INT(s/6)+1,MOD(s,6)+1))
This worked well, thank you very much :)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,077
Members
449,094
Latest member
mystic19

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