Compile a Column into a List

nputt

New Member
Joined
Dec 3, 2020
Messages
16
Office Version
  1. 2011
Platform
  1. Windows
  2. Mobile
Hello, not sure if Excel even has this capability. (Using 365)
I have a meal planner that I use on Excel that separates columns by food type (protein, veggie, car, etc), I'd like to make a grocery list by combining the data listed in a single column into a single cell. EX: IF B3 = Lettuce, B4 = Tomatoes, and B5 = Apples; how can I make B7= Lettuce, Tomatoes, Apples by formula rather than manual entry.
Thank you.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Ok, how about
Excel Formula:
=TEXTJOIN(", ",,UNIQUE(TRIM(MID(SUBSTITUTE(TEXTJOIN(",",TRUE,G4:G9,""),",",REPT(" ",100)),SEQUENCE(LEN(TEXTJOIN(",",TRUE,G4:G9,""))-LEN(SUBSTITUTE(TEXTJOIN(",",TRUE,G4:G9,""),",",""))+1,,0)*100+1,100))))
I would advise you to get rid of those merged cells, they can cause a lot of problems.
 
Upvote 0
If you got the UNIQUE function, this thing works perfectly, put it in cell L2

=TEXTJOIN(", ",TRUE,(UNIQUE(G4:G9)),"")
 
Upvote 0
Not a problem.

It may not be a problem for you, but if you use @aghaffar82 formula in col H you will get
Tomato Sauce, Beans, Tomato Sauce, Pickles
rather than
Tomato Sauce, Beans, Pickles

which my formula will give you.
 
Upvote 0
Not a problem.

It may not be a problem for you, but if you use @aghaffar82 formula in col H you will get
Tomato Sauce, Beans, Tomato Sauce, Pickles
rather than
Tomato Sauce, Beans, Pickles

which my formula will give you.
The LET function might be hidden in my Insert Functions. I'll look back through them when I get the chance again (at work.) If I do have the LET function what would that look like?
 
Upvote 0
Like
Excel Formula:
=LET(Joined,TEXTJOIN(",",TRUE,G4:G9,""), TEXTJOIN(", ",,UNIQUE(TRIM(MID(SUBSTITUTE(Joined,",",REPT(" ",100)),SEQUENCE(LEN(Joined)-LEN(SUBSTITUTE(Joined,",",""))+1,,0)*100+1,100)))))
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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