How to concatenate and format multiple columns

jeangodecoster

New Member
Joined
Dec 16, 2020
Messages
1
Office Version
  1. 365
Platform
  1. MacOS
Hi,
I would like to use an excel formula to generate markup text based on the content of multiple columns, the row header and the column header.
So for example here is the content of my 3 columns:

CharacterFRENNL
CharlieBonjour!Hello!Hallo!

and I'd like a formula that would generate the following markup:


HTML:
<div class="Charlie">
    <div id="FR">
        Bonjour!
    </div>
    <div id="EN">
        Hello!
    </div>
    <div id="NL">
        Hallo!
    </div>
</div>

Is there a way to do this with a formula? I know I could add 3 extra columns, with a concat function to build the div for each language, and then concatenate all those three, but is there a way to do this with one single function (that would ideally take the range and then apply some transformation to each element in the range, and produce the whole shebang in one fell swoop.

Or do I have to resort to VBA instead?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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