Split sentence into rows - No wrapping

cshetty

Board Regular
Joined
Apr 15, 2017
Messages
76
Office Version
  1. 2016
Platform
  1. Windows
I have a tricky requirement. (Tricky for me )

My sentence in excel cell is "US DOLLARS NINE HUNDRED SIXTY EIGHT THOUSAND SEVEN HUNDRED FIFTY SEVEN ONLY"

I need to print this on a pre printed pay-order stationery. The width of the line is limited on the stationery. I can print up to US DOLLARS NINE HUNDRED SIXTY EIGHT THOUSAND SEVEN HUNDRED on the first line and FIFTY SEVEN ONLY should go to the next line on the stationery.

I tried with wrapping the text in excel cell, but one of sentence prints on the line of the stationery.
Is there a way to split the line using a formula so that i can distribute the line into two rows.

Hope i have explained my query properly.
 
In A2
Excel Formula:
=IF( LEN(A1)>55,LEFT(A1,FIND(" ",A1,INT(LEN(A1)/2))-1),A1)
In A3
Excel Formula:
=IF( LEN(A1)>55,SUBSTITUTE(A1,A2&" ",""),"")
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try this. Experiment with changing the "40" in the formula until you have a number that roughly suits your required column width.

23 01 12.xlsm
A
1US DOLLARS NINE HUNDRED SIXTY EIGHT THOUSAND SEVEN HUNDRED FIFTY SEVEN ONLY
2US DOLLARS NINE HUNDRED SIXTY EIGHT THOUSAND
3SEVEN HUNDRED FIFTY SEVEN ONLY
Split
Cell Formulas
RangeFormula
A2A2=IFERROR(LEFT(A1,FIND(" ",A1,40)-1),A1)
A3A3=REPLACE(A1,1,LEN(A2)+1,"")
 
Upvote 0
So, have you tried any of the recent formulas suggested?
 
Upvote 0
Try this. Experiment with changing the "40" in the formula until you have a number that roughly suits your required column width.

23 01 12.xlsm
A
1US DOLLARS NINE HUNDRED SIXTY EIGHT THOUSAND SEVEN HUNDRED FIFTY SEVEN ONLY
2US DOLLARS NINE HUNDRED SIXTY EIGHT THOUSAND
3SEVEN HUNDRED FIFTY SEVEN ONLY
Split
Cell Formulas
RangeFormula
A2A2=IFERROR(LEFT(A1,FIND(" ",A1,40)-1),A1)
A3A3=REPLACE(A1,1,LEN(A2)+1,"")
Mr. Peter

I guess your solution going to work for me. Let me try some samples before ticking Solution mark :)

Made a small change to formula incase if i have a shorter length. than 45.

=LEFT (A1, FIND (" 1, MIN(LEN(A1),45))-1)
 
Upvote 0
Made a small change to formula incase if i have a shorter length. than 45.

=LEFT (A1, FIND (" 1, MIN(LEN(A1),45))-1)
That isn't a valid formula.
In any case, my suggested formula for A2 (& A3) already handles the case if the A1 text is short. Did you try it with short text?

23 01 12.xlsm
A
1US DOLLARS NINE HUNDRED
2US DOLLARS NINE HUNDRED
3 
Split
Cell Formulas
RangeFormula
A2A2=IFERROR(LEFT(A1,FIND(" ",A1,40)-1),A1)
A3A3=REPLACE(A1,1,LEN(A2)+1,"")
 
Upvote 0
Solution
That isn't a valid formula.
In any case, my suggested formula for A2 (& A3) already handles the case if the A1 text is short. Did you try it with short text?

23 01 12.xlsm
A
1US DOLLARS NINE HUNDRED
2US DOLLARS NINE HUNDRED
3 
Split
Cell Formulas
RangeFormula
A2A2=IFERROR(LEFT(A1,FIND(" ",A1,40)-1),A1)
A3A3=REPLACE(A1,1,LEN(A2)+1,"")
Oh Ya..

Only thing is I have to make sure there is a space at the end of the main sentence in A1. Thats not an issue.
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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