?
Solved

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

Posted on 2013-01-26
3
Medium Priority
?
230 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
[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
3 Comments
 
LVL 43

Assisted Solution

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

Accepted Solution

by:
Patrick Matthews earned 1000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

770 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