Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Excel Formula to Pull Data from Text String

Posted on 2016-08-03
Medium Priority
82 Views
Hello -

Based on the attached example I am looking for a formula that will pull the text between the 3rd and 4th "~" in the string.  So the result from cell A1 would be alpha,  Result from cell A4 would be ZT, etc.  All results can be placed in column B.

Thanks!
0
Question by:Escanaba
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 1

Author Comment

ID: 41740865
0

LVL 43

Accepted Solution

Saqib Husain, Syed earned 2000 total points
ID: 41740889
=TRIM(LEFT(SUBSTITUTE(REPLACE(A1,1,FIND("<",SUBSTITUTE(A1,"~","<",3)),""),"~",REPT(" ",9999)),100))
0

LVL 33

Expert Comment

ID: 41740948

In B1
``````=TRIM(MID(SUBSTITUTE(A1,"~",REPT(" ",LEN(A1))),LEN(A1)*3,LEN(A1)))
``````
and then copy it down.
0

LVL 53

Expert Comment

ID: 41740964
Hi,

pls try

``````=TRIM(MID(SUBSTITUTE(A1,"~",REPT(" ",999)),3*999,999))
``````
Regards
0

LVL 7

Expert Comment

ID: 41740971
See attached.  Use the Text To Column function.  Instructions in the spreadsheet attached.
EE-Example--1-.xlsx
0

LVL 1

Author Closing Comment

ID: 41741271
Thanks!
0

LVL 43

Expert Comment

ID: 41741572
Thanks for the points but I do wonder why you did not consider the shorter formulas.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will diâ€¦
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and installâ€¦
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This lâ€¦
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filledâ€¦
###### Suggested Courses
Course of the Month8 days, 22 hours left to enroll