Formula or code to change formatting in cell

rmtimmah

Board Regular
Joined
May 14, 2007
Messages
153
Hi,

I have a formula to concatenate multiple cells to one cell. What I would like to do is have the second part of the text in Italics and on a new line. Formula at the moment is:

=CONCATENATE(IF(Question1!C$2="Yes",Question1!B$2 & " ",""),IF(Question1!C$3="Yes",Question1!B$3 & " ",""))

So I would like to see the result look like this in one cell:

Text1
Text2
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Well, we can do the part about putting the 2nd text on a new line.
But you cannot format a portion of the formula's result in italics...Sorry.

=CONCATENATE(IF(Question1!C$2="Yes",Question1!B$2 & " ",""),CHAR(10),IF(Question1!C$3="Yes",Question1!B$3 & " ",""))
You will have to go to Format - Cells - Alignment and check "Wrap Text"
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,993
Messages
5,856,695
Members
431,828
Latest member
kARTIK12345

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
Top