Formula to show contents of multiple cells comma seperated in a single cell

kyleno

Board Regular
Joined
Jun 9, 2014
Messages
61
I am looking to use a dynamic formula to show contents of multiple cells comma separated in a single cell.

For example,

I have a range of 10 cells (horizontal) that may or may not contain a value. I would like the formula to simply show what values are in that range and update as data is added or removed.

Concatenate does not work quite right, as there are lots of extra commas left in the cell.

Please help.
 
Last edited:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi

would something like this work for you??

=A1&","&B1&","&C1

or do you sometimes have blank cells

Is it only ever 10 cells

Dave
 
Last edited:
Upvote 0
or with blank cells, maybe?

=IF(A1<>0,A1&",","")&IF(B1<>0,B1&",","")&IF(C1<>0,C1&",","")&IF(D1<>0,D1&",","")&IF(E1<>0,E1&",","")&IF(F1<>0,F1&",","")&IF(G1<>0,G1&",","")&IF(H1<>0,H1&",","")&IF(I1<>0,I1&",","")&IF(J1<>0,J1,"")

dave
 
Upvote 0
This worked great! I just needed to add a space after each comma and it works perfectly. Thanks so much!

or with blank cells, maybe?

=IF(A1<>0,A1&",","")&IF(B1<>0,B1&",","")&IF(C1<>0,C1&",","")&IF(D1<>0,D1&",","")&IF(E1<>0,E1&",","")&IF(F1<>0,F1&",","")&IF(G1<>0,G1&",","")&IF(H1<>0,H1&",","")&IF(I1<>0,I1&",","")&IF(J1<>0,J1,"")

dave
 
Upvote 0
Or maybe...

=SUBSTITUTE(TRIM(A1&" "&B1&" "&C1&" "&D1&" "&E1&" "&F1&" "&G1&" "&H1&" "&J1)," ",", ")

M.
 
Upvote 0
This worked great! I just needed to add a space after each comma and it works perfectly. Thanks so much!

Your very welcome.
Glad it worked for you.

Regards

dave.
 
Upvote 0
@AhoyNC This looks nice and simple, but I'm using 2013 right now. Thanks though!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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