Concatenate a row or part of

StuartWhi

Board Regular
Joined
Sep 1, 2011
Messages
75
Hi all,

I have been reading quite a few posts on this and haven’t managed to find what will work for me,
- Several post talking about using VBA, but unfortunately as I’m sharing the document so this wouldn't be ideal (many won’t accept macros),
- Several talking about a non-standard functions which runs a plugin (such as “concatIf”) or VBA also not ideal due to the above.

What I would like to do is concatenate a group of cells if they have text in them.
Quick background, arranging an extended family gathering and people are arriving / departing on different dates,
- Have found each instance of a date and using that to place the who arrive on the same date in different columns,
Arival Date / TimePeople 1.0People 1.1People 1.2People 1.3People 1.4People 1.5People 1.6People 1.7People 1.8People 1.9People 1.10
Tue, 24-Mar-15, 0:00Shirl, Steve, Anthony, Nicole, Chloe
Wed, 25-Mar-15, 16:30Lea, BrettNeil, ValDennis, Marie, TobiYol, Kris, Kyan, AddyJill, Barry
Thu, 26-Mar-15, 18:30Pat, SuzanneStuart, El

<tbody>
</tbody>
I would like to use a formula to then concatenate these into a common cell with a “, “ {comma then space} between them.
- I can achieve this by using this formula but it’s very long and ugly (embedded If’s) is there are better way to do this in a formula.

=IF(J5<>"",IF(AK5<>"",AA5&", "&AB5&", "&AC5&", "&AD5&", "&AE5&", "&AF5&", "&AG5&", "&AH5&", "&AI5&", "&AJ5&", "&AK5,IF(AJ5<>"",AA5&", "&AB5&", "&AC5&", "&AD5&", "&AE5&", "&AF5&", "&AG5&", "&AH5&", "&AI5&", "&AJ5,IF(AI5<>"",AA5&", "&AB5&", "&AC5&", "&AD5&", "&AE5&", "&AF5&", "&AG5&", "&AH5&", "&AI5,IF(AH5<>"",AA5&", "&AB5&", "&AC5&", "&AD5&", "&AE5&", "&AF5&", "&AG5&", "&AH5,IF(AG5<>"",AA5&", "&AB5&", "&AC5&", "&AD5&", "&AE5&", "&AF5&", "&AG5,IF(AF5<>"",AA5&", "&AB5&", "&AC5&", "&AD5&", "&AE5&", "&AF5,IF(AE5<>"",AA5&", "&AB5&", "&AC5&", "&AD5&", "&AE5,IF(AD5<>"",AA5&", "&AB5&", "&AC5&", "&AD5,IF(AC5<>"",AA5&", "&AB5&", "&AC5,IF(AB5<>"",AA5&", "&AB5,IF(AA5<>"",AA5,""))))))))))),"")

All I’m doing in the above is repeating the same thing, checking if the cell has anything in it, if it does add it to the cells before it. There are 10 cells it checks for data thus the reason for being so long.

Any ideas would be appreciated.

Thanks,

Stuart.
 
This formula tries to handle the case when several names belong to the same person:

=SUBSTITUTE(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(AA5&"#"&AB5&"#"&AC5&"#"&AD5&"#"&AE5&"#"&AF5&"#"&AG5&"#"&AH5&"#"&AI5&"#"&AJ5&"#"&AK5," ","|"),"#"," "))," ",", "),"|"," ")
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,215,573
Messages
6,125,608
Members
449,238
Latest member
wcbyers

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