Adding Characters to a line of information

esb128

New Member
Joined
Feb 21, 2014
Messages
19
Office Version
  1. 365
Platform
  1. Windows
Hello,

I need help creating a formula to insert the following data between the large spaces of information i have in multiple lines below *** Please note there are about 5 spaces between these sentances, but when i save it the website removes the extra spaces.

Problem

Positive seal sealing and holding is accomplished instantaneously Reusable connect and disconnect numerous times Full flow fitting seals on outside diameter of tubing Internal hex allows ease of assembly in tight places Pre-applied thread sealant

Answer

Positive seal sealing and holding is accomplished instantaneously</li><li>Reusable connect and disconnect numerous times</li><li>Full flow fitting seals on outside diameter of tubing</li><li>Internal hex allows ease of assembly in tight places</li><li>Pre-applied thread sealant
 
Last edited:

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi,

What do you mean by "the large spaces of information"?

If you could provide some sample data and expected results, it will be easier for us to help you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data, allowing us to copy/paste it to our Excel spreadsheets to work with the same data you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that this board also has a "Test Here” forum. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

Thanks,

Doug
 
Upvote 0
Thanks, i am having trouble with the xl2bb, to make it more simple, every new sentance in the data has a capitalized letter, can it be programmed to insert the </li><li> before each capitalized letter?
 
Upvote 0
Hello, I am revising the wording of my ask, which should make it more simple

Hello,

I need help creating a formula to insert an </li><li> in the following data before each capitalized word in the sentence below, it must skip the first capitalized word in the sentence.

Data

Positive seal sealing and holding is accomplished instantaneously Reusable connect and disconnect numerous times Full flow fitting seals on outside diameter of tubing Internal hex allows ease of assembly in tight places Pre-applied thread sealant

Result

Positive seal sealing and holding is accomplished instantaneously</li><li>Reusable connect and disconnect numerous times</li><li>Full flow fitting seals on outside diameter of tubing</li><li>Internal hex allows ease of assembly in tight places</li><li>Pre-applied thread sealant
 
Upvote 0
I am not sure that your question is different...

I have a solution that would require helper at least one helper column to locate the "space" before the capital letters. This single helper column would require combining columns B through G in my example below; that is not too difficult with a LET formula. The part I cannot get my head around is multiple REPLACES within a string. Can this be done with a single formula that identifies the positions to be replaced?
Book1
ABCDEFGHI
1Positive seal sealing and holding is accomplished instantaneously Reusable connect and disconnect numerous times Full flow fitting seals on outside diameter of tubing Internal hex allows ease of assembly in tight places Pre-applied thread sealantBroken down into Single LettersAscii CodesCapital LettersPositionCaps from column DPosition of Space before CapsSpace replaced with specified text; one at a time; is there a way to do this with a single formula?
2P80111220Positive seal sealing and holding is accomplished instantaneously Reusable connect and disconnect numerous times Full flow fitting seals on outside diameter of tubing Internal hex allows ease of assembly in tight places</li><li>Pre-applied thread sealant
3o111020167Positive seal sealing and holding is accomplished instantaneously Reusable connect and disconnect numerous times Full flow fitting seals on outside diameter of tubing</li><li>Internal hex allows ease of assembly in tight places</li><li>Pre-applied thread sealant
4s115030113Positive seal sealing and holding is accomplished instantaneously Reusable connect and disconnect numerous times</li><li>Full flow fitting seals on outside diameter of tubing</li><li>Internal hex allows ease of assembly in tight places</li><li>Pre-applied thread sealant
5i10504066Positive seal sealing and holding is accomplished instantaneously</li><li>Reusable connect and disconnect numerous times</li><li>Full flow fitting seals on outside diameter of tubing</li><li>Internal hex allows ease of assembly in tight places</li><li>Pre-applied thread sealant
6t116050
7i105060
8v118070
9e101080
10 32090
11s1150100
12e1010110
13a970120
14l1080130
15 320140
16s1150150
17e1010160
18a970170
19l1080180
20i1050190
21n1100200
22g1030210
23 320220
24a970230
25n1100240
26d1000250
27 320260
Sheet1
Cell Formulas
RangeFormula
B2:B247B2=MID($A$1,ROW(INDIRECT("$A$1:$A$"&LEN($A$1))),1)
C2:C247C2=CODE(MID($A$1,ROW(INDIRECT("$A$1:$A$"&LEN($A$1))),1))
D2:D247D2=BYROW(C2#,LAMBDA(x,IF(AND(x>=65,x<=90),1,0)))
F2:G247F2=HSTACK(SEQUENCE(LEN(A1)),D2#)
H2:H5H2=SORT(FILTER(INDEX(F2#,,1),(INDEX(F2#,,1)>1)*(INDEX(F2#,,2)=1))-1,,-1)
I2I2=REPLACE($A$1,H2,1,"</li><li>")
I3:I5I3=REPLACE(I2,H3,1,"</li><li>")
Dynamic array formulas.

Maybe some has a way to do the REPLACE in a single formula...

Hope that helps get it headed in the right direction,

Doug
 
Upvote 0
As you appear to have non-braking spaces in the gaps, another option is
Fluff.xlsm
AB
1
2Positive seal sealing and holding is accomplished instantaneously Reusable connect and disconnect numerous times Full flow fitting seals on outside diameter of tubing Internal hex allows ease of assembly in tight places Pre-applied thread sealantPositive seal sealing and holding is accomplished instantaneously</li><li>Reusable connect and disconnect numerous times</li><li>Full flow fitting seals on outside diameter of tubing</li><li>Internal hex allows ease of assembly in tight places</li><li>Pre-applied thread sealant
Data
Cell Formulas
RangeFormula
B2B2=TEXTJOIN("</li><li>",,TRIM(TEXTSPLIT(A2,CHAR(160))))


If you had posted your data using the XL2BB add-in that could have been seen as shown above. ;)
 
Upvote 0
Wish I figured out those were there, would have saved me a bunch of time screwing around. I could have screwed around on other stuff. I am not working on anything without data anymore:cry:

Besides the point now, is there a way to do multiple REPLACEs in a single formula? I am sure a recursive LAMBDA or VBA could handle this without a problem...I am wondering about a worksheet formula that is less complicated than a recursive LAMBDA.

Doug
 
Upvote 0
You would need Lambda or VBA
 
Upvote 0
=TEXTJOIN("</li><li>",,TRIM(TEXTSPLIT(A2,CHAR(160))))
thank you very much, it wont work i think there is a formatting issue in the data, im attaching an image of what the text looks like in the cell vs what it looks like in the formula box, in the cell there are no spaces but in the formula box it has spaces.
 

Attachments

  • mr excel.jpg
    mr excel.jpg
    44.4 KB · Views: 5
Upvote 0
You will either have to provide XL2BB data or learn how to determine what characters are in your text strings. My example above should help you determine what characters are in your strings.

Doug
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,199
Members
453,022
Latest member
RobertV1609

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