Merge multiple cells based on contents of other cells

slam

Well-known Member
Joined
Sep 16, 2002
Messages
921
Office Version
  1. 365
  2. 2019
Hi all!

Below is a silly mockup of what I'm trying to achieve. I am trying to automate the Order column. First it should add the person's name to the Order column, then where there's an x in the animal columns, it should add the respective text from row 1 to the order column.


Example.xls
ABCDEF
1NameDogCatCowHorseOrder
2JamesxxJames. Dog. Cow.
3AndrewxxAndrew. Cat. Horse.
4StephaniexxxxStephanie. Dog. Cat. Cow. Horse
Sheet3


I'm familiar with the likes of this formula below, but then I need to automate this based on the x's, as there are many rows.
Excel Formula:
=A2&". "&B1&". "&D1&"."

Any help would be greatly appreciated!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi Eric - Thank you! Realized I had to enter it as an array formula, but maybe that's because this is on Excel 2019. Works perfectly anyway, and I modified for my actual column references.
 
Upvote 0
Good job realizing that 2019 needs the array formula, newer versions default to array formula by default.

Glad I could help! :cool:
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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