Solved

Function to remove all character in a cell following the first space

Posted on 2013-01-26
3
224 Views
Last Modified: 2013-01-27
How can I remove all characters in a cell following the first space and remove the space also?

In other words...

"435678TD45   sgepr"

would result in...

"435678TD45" only.

--Steve
0
Comment
Question by:SteveL13
3 Comments
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 250 total points
ID: 38822470
=left(A1,find(" ",A1)-1)
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 250 total points
ID: 38822604
In the event you have any entries with no spaces, or blanks, that formula will return an error.

To return the whole string if there are no spaces:

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

This will return a zero-length string if A1 is blank.
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

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
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…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

863 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

23 Experts available now in Live!

Get 1:1 Help Now