I have a spreadsheet that I am using as a questionnaire.
One of the questions is
Who are your wheel suppliers (mark all that apply)? and there are 6 check boxes in column C to select 5 different wheel suppliers and an
Other option. I have these check boxes linked to return whatever suppliers name is selected in the cell adjacent to the cell the check box is in in column I.
So depending on what wheel suppliers the customer selects there could be anywhere from 1-6 different suppliers selected. So once the customer has selected the wheel suppliers whatever suppliers are selected will show up in the correct cell in range
What I am having a problem with is that I need these to pull into a data tab into one cell. I am having a problem coming up with a formula to put all the suppliers together as a list in one cell with commas separating each. Remember, it could be 1 supplier, could be 3, could be 6.
Any advice is much appreciated. I have tried using If formulas and Concatenate but I can’t seem to figure out how to get it to work like I want it to.
=CONCATENATE(Questionnaire!I45," ",Questionnaire!I46," ",Questionnaire!I47," ",Questionnaire!I48," ",Questionnaire!I49," ",Questionnaire!I50)
That is the best I’ve come up with but the problem with it is if the first supplier isn’t selected then it will enter that space anyways and if the first supplier and the last supplier are selected it will have all those spaces in between.
Another method, this one using helper cells.
Say you have the data in
B1, input this formula:
=IF(LEN(A1)>0,A1&",",""). Drag down to
B6, slight variation:
What happens is the cells in the B column checks if their respective values in the A column are not blanks. If not, they will append
, to it. Otherwise, they will return blanks (not spaces). The only variation is
B6–since it’s the end of the list, there’s no
, appended to it.
It’s only a matter of concatenating them at this point. Removing any of the values in
A, maybe by unchecking their checkbox, will reflect the change in
Let us know if this helps.
To accommodate your formula, change your
CONCATENATE formula to something like below:
What is does is it removes the rightmost character by getting, from the left, all the characters up until one less than the length of the result. Obviously, fill in the
... with the ranges you want to concatenate.
Let us know if this is what you need.
Looks ugly, right? But does the job. Better if you use a named range, though, like below:
Now it’s much shorter. Error on my end is because I don’t have
Questionnaire sheet, obviously.
If J44 is blank and you are prepared to add something like
=IF(ISBLANK(I45),J44,J44&I45&", ") in J45 (copied down) then perhaps:
might suit, where wheelC is a named range of workbook scope for Questionnaire!J50.