Solved

Excel 2007 Formula to Pull Text Before A Certain Character

Posted on 2016-11-02
2
58 Views
Last Modified: 2016-11-02
Hello,

Can someone provide a formula that will pull all the text in a cell that appears before the first appearance of {?  For example, if the cell contains the following: Hello World {123} the formula would return:  Hello World.  If there is no { in the text string then it would just return the full text in the cell.

Thanks
0
Comment
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
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
Brian B earned 500 total points
ID: 41870332
It can be done with a FIND() and LEFT(). The trick is just to catch the error and return the whole text as you described if the cell doesn't have a { in it.

Try this:
=IF(ISERROR(FIND("{",A1)),A1,LEFT(A1,FIND("{",A1)-2))

Note: The -2 at the end moves back two characters from the {. So the { character and the space before it are not included.
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 41870347
Hi,

pls try
=LEFT(A1,FIND("{",A1)-1)

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question