Filter column to add multiple cells into one cell

PuntingJawa

Board Regular
Joined
Feb 25, 2021
Messages
140
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I'm trying to automate separation of lines with the filter function based on what number is in column B.
Example:
Filter if a cell in Column B has number 1 then return the adjacent cell in column C "space" D "Space and E with no empty cells between.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Can you post some sample data & expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Can you post some sample data & expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
Sure thing! I am trying to filter where it looks like the below XL2BB.
Book2
ABCDEFGHI
1DATAEXAMPLE
2AREAS/NPN1PN2AREA 1AREA 2AREA 3AREA 4
33DMC233217D7323-000166SP455211DMC233217 D7323-000166 SP455211DMC233221 D7323-000166 SP455211
43DMC233218D7323-000166SP455211DMC233218 D7323-000166 SP455211DMC233226 D7323-000166 SP455211
53DMC233220D7323-000166SP455211DMC233220 D7323-000166 SP455211
64DMC233221D7323-000166SP455211
74DMC233226D7323-000166SP455211
Sheet1
 
Upvote 0
Thanks for that.
How about
Fluff.xlsm
ABCDEFGHI
1DATAEXAMPLE
2AREAS/NPN1PN2AREA 1AREA 2AREA 3AREA 4
33DMC233217D7323-000166SP455211 DMC233217 D7323-000166 SP455211DMC233221 D7323-000166 SP455211
43DMC233218D7323-000166SP455211DMC233218 D7323-000166 SP455211DMC233226 D7323-000166 SP455211
53DMC233220D7323-000166SP455211DMC233220 D7323-000166 SP455211
64DMC233221D7323-000166SP455211
74DMC233226D7323-000166SP455211
8
Sheet5
Cell Formulas
RangeFormula
F3:I5F3=DROP(REDUCE("",SEQUENCE(4),LAMBDA(x,y,IFNA(HSTACK(x,BYROW(FILTER(B3:D100,A3:A100=y,""),LAMBDA(br,TEXTJOIN(" ",,br)))),""))),,1)
Dynamic array formulas.
 
Upvote 1
Solution
Thanks for that.
How about
Fluff.xlsm
ABCDEFGHI
1DATAEXAMPLE
2AREAS/NPN1PN2AREA 1AREA 2AREA 3AREA 4
33DMC233217D7323-000166SP455211 DMC233217 D7323-000166 SP455211DMC233221 D7323-000166 SP455211
43DMC233218D7323-000166SP455211DMC233218 D7323-000166 SP455211DMC233226 D7323-000166 SP455211
53DMC233220D7323-000166SP455211DMC233220 D7323-000166 SP455211
64DMC233221D7323-000166SP455211
74DMC233226D7323-000166SP455211
8
Sheet5
Cell Formulas
RangeFormula
F3:I5F3=DROP(REDUCE("",SEQUENCE(4),LAMBDA(x,y,IFNA(HSTACK(x,BYROW(FILTER(B3:D100,A3:A100=y,""),LAMBDA(br,TEXTJOIN(" ",,br)))),""))),,1)
Dynamic array formulas.
Thank you very much as always. If I need more columns I just switch the sequence number to a higher or lower number. This is exactly what I was looking for <3
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,132
Messages
6,123,227
Members
449,091
Latest member
jeremy_bp001

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