Solved

How do I enter a formula in Excel to capture a part of text from a cell?

Posted on 2016-11-21
7
30 Views
Last Modified: 2016-12-04
Hi,

I have values on my worksheet in column A. I want to capture from column A the contents on the left before the first space. Below are some examples. Do you have a formula for this? It's okay if the formula looks at only cell A1. I can copy the formula down to capture everying on column A.

Have                                                               Want

CarMax_TOT Special                                    CarMax_TOT
Toyota                                                            Toyota
Today don't go to work                               Today

Conernesto
0
Comment
Question by:Conernesto
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 13

Expert Comment

by:StellanRosengren
ID: 41896096
=LEFT(A1,FIND(" ",A1)-1)
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41896116
You could also use the Text to Columns wizard to split the text at spaces. This would put the text into several columns, based on the number of spaces but you would then just delete those that you don't need.
0
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 41896120
That formula will give an error with the second entry.

You can add a virtual space at the end to ensure that if the entry is only one word, then that word will be returned.

e.g

=LEFT(A1,FIND(" ",A1&" ")-1)

or you can use IFERROR

e.g. =IFERROR(LEFT(A1,FIND(" ",A1)-1) ,A1)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Conernesto
ID: 41896122
The formula is not working for items that don't have a space. On my example above Toyota doesn't have a space. The value Toyota is not being returned with the formula you provided.
0
 
LVL 23

Expert Comment

by:NBVC
ID: 41896124
See my reply.
0
 
LVL 13

Expert Comment

by:StellanRosengren
ID: 41896129
You are absolutely right. NBVC provided the solution.
0
 

Author Closing Comment

by:Conernesto
ID: 41896161
Thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

911 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now