Wrap text string text in cell using formula

sspatriots

Well-known Member
Joined
Nov 22, 2011
Messages
585
Office Version
  1. 365
Platform
  1. Windows
Hi,

I tried using the "CHAR(10" inserted into this string of text in a formula to get it to wrap the text string in several places, however, it would not work. I don't want to set the whole column to wrap text.

="TBD or"&CHAR(10)&"Select NA"&CHAR(10)&"for Vendor"


Therefore, I tried the following formula, (something I got the idea from in another post of mine a few weeks back, but it would not wrap the texts either. If anyone can show me a way to do this with a formula, it would be greatly appreciated. Thanks, SS

=TEXTJOIN(CHAR(10),,TRIM(TEXTSPLIT("TBD or Select NA for Vendor"," ")))
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Can you not just set the result cell to wrap text?

The CHAR(10) won't do anything unless the cell format is set to wrap text. Both of your formulae wrap the text but in different places.

Here is another formula that does the same as your first formula:
Excel Formula:
=LET(t,{"TBD or","Select NA","for Vendor"},TEXTJOIN(CHAR(10),,t))
 
Upvote 0
Solution
To do that, select the cells you want this to happen on, hit CTRL-1
Click on the Alignment tab, under Text Control, click on Wrap Text. Click OK.

1699018795652.png
 
Upvote 0
Can you not just set the result cell to wrap text?

The CHAR(10) won't do anything unless the cell format is set to wrap text. Both of your formulae wrap the text but in different places.

Here is another formula that does the same as your first formula:
Excel Formula:
=LET(t,{"TBD or","Select NA","for Vendor"},TEXTJOIN(CHAR(10),,t))
Perfect. Thank you, I can work with this.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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