• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 70
  • Last Modified:

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

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
Conernesto
Asked:
Conernesto
  • 2
  • 2
  • 2
  • +1
1 Solution
 
StellanRosengrenCommented:
=LEFT(A1,FIND(" ",A1)-1)
0
 
Rob HensonIT & Database AssistantCommented:
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
 
NBVCCommented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ConernestoAuthor Commented:
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
 
NBVCCommented:
See my reply.
0
 
StellanRosengrenCommented:
You are absolutely right. NBVC provided the solution.
0
 
ConernestoAuthor Commented:
Thank you.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now