Please help with a formula

Djoshua

New Member
Joined
May 5, 2010
Messages
5
Im new on excel and want to put information from 5 different cells all into one cell but the information extracted from the 5 different cells should be separated by a "," in the cell that it gets inserted in. And if there is blank in one of the 5 cells then it should not just put in a ",".

For example
Cell A1 :house 1 Then in Cell B1: House 1,Wall Street,New York,1252
Cell A2: Wall Street
Cell A3: "blank" NB Not:House 1, Wall Street,,New York,1252
Cell A4:New York
Cell A5: 1252

But if there was something in Cell A3 then it gets inserted in cell B1 with the rest of the info.

If someone could please give me some advice on what to do I would really appreciate it :)
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Try

=SUBSTITUTE(IF(A1<>"",","&A1,"")&IF(A2<>"",","&A2,"")&IF(A3<>"",","&A3,"")&IF(A4<>"",","&A4,"")&IF(A5<>"",","&A5,""),",","",1)
 
Upvote 0

Forum statistics

Threads
1,216,757
Messages
6,132,538
Members
449,735
Latest member
Gary_M

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