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.
 
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)))))
Ended up finding it (LET) and it worked like a charm. Thank you everyone for your assistance! I've learned quite a bit today!
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Glad we could help & thanks for the feedback.
 
Upvote 0
Ended up finding it (LET) and it worked like a charm.
Are you sure?

In cell I14 below I have used the suggested formula. You will notice that the result includes two "non-ingredients" ("Garli" and "c & Onion Powder") and excludes one real ingredient ("Ranch")
The issue could possibly be overcome by increasing the 100 values in the formula to, say, 1000 but the issue could still arise if there is a reasonably long list of ingredients in a column.

An alternative that should do the job without having to figure out how many spaces to insert is provided in I15.

nputt.xlsm
I
4Italian Seasoning, Butter
5Soy Sauce
6Mayo, Mustard, Ketchup
7Garlic & Onion Powder, Minced Garlic, Butter
8Garlic & Onion Powder, Cajun, Butter
9Ketchup, Mustard, Mayo, BBQ, Buffalo, Ranch
10
11
12
13
14Italian Seasoning, Butter, Soy Sauce, Mayo, Mustard, Ketchup, Garlic & Onion Powder, Minced Garlic, Garli, c & Onion Powder, Cajun, BBQ, Buffalo
15Italian Seasoning, Butter, Soy Sauce, Mayo, Mustard, Ketchup, Garlic & Onion Powder, Minced Garlic, Cajun, BBQ, Buffalo, Ranch
Sheet1
Cell Formulas
RangeFormula
I14I14=LET(Joined,TEXTJOIN(",",TRUE,I4:I9,""), TEXTJOIN(", ",,UNIQUE(TRIM(MID(SUBSTITUTE(Joined,",",REPT(" ",100)),SEQUENCE(LEN(Joined)-LEN(SUBSTITUTE(Joined,",",""))+1,,0)*100+1,100)))))
I15I15=LET(Joined,","&TEXTJOIN(",",TRUE,I4:I9)&",",Parts,REPLACE(Joined,1,FIND("#",SUBSTITUTE(Joined,",","#",SEQUENCE(LEN(Joined)-LEN(SUBSTITUTE(Joined,",",""))-1))),""),TEXTJOIN(", ",,UNIQUE(TRIM(LEFT(Parts,FIND(",",Parts)-1)))))
 
Upvote 0
Solution
Are you sure?

In cell I14 below I have used the suggested formula. You will notice that the result includes two "non-ingredients" ("Garli" and "c & Onion Powder") and excludes one real ingredient ("Ranch")
The issue could possibly be overcome by increasing the 100 values in the formula to, say, 1000 but the issue could still arise if there is a reasonably long list of ingredients in a column.

An alternative that should do the job without having to figure out how many spaces to insert is provided in I15.

nputt.xlsm
I
4Italian Seasoning, Butter
5Soy Sauce
6Mayo, Mustard, Ketchup
7Garlic & Onion Powder, Minced Garlic, Butter
8Garlic & Onion Powder, Cajun, Butter
9Ketchup, Mustard, Mayo, BBQ, Buffalo, Ranch
10
11
12
13
14Italian Seasoning, Butter, Soy Sauce, Mayo, Mustard, Ketchup, Garlic & Onion Powder, Minced Garlic, Garli, c & Onion Powder, Cajun, BBQ, Buffalo
15Italian Seasoning, Butter, Soy Sauce, Mayo, Mustard, Ketchup, Garlic & Onion Powder, Minced Garlic, Cajun, BBQ, Buffalo, Ranch
Sheet1
Cell Formulas
RangeFormula
I14I14=LET(Joined,TEXTJOIN(",",TRUE,I4:I9,""), TEXTJOIN(", ",,UNIQUE(TRIM(MID(SUBSTITUTE(Joined,",",REPT(" ",100)),SEQUENCE(LEN(Joined)-LEN(SUBSTITUTE(Joined,",",""))+1,,0)*100+1,100)))))
I15I15=LET(Joined,","&TEXTJOIN(",",TRUE,I4:I9)&",",Parts,REPLACE(Joined,1,FIND("#",SUBSTITUTE(Joined,",","#",SEQUENCE(LEN(Joined)-LEN(SUBSTITUTE(Joined,",",""))-1))),""),TEXTJOIN(", ",,UNIQUE(TRIM(LEFT(Parts,FIND(",",Parts)-1)))))
Thank you. I was actually just coming here today to say that for some reason one of my cells was not being included. This response resolved the issues fully.
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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