How to extract all words in a cell except the last one?

I'm sure that has been solved before, but I cannot find or figure ou
the right formula so far.

I have a column of cells that have the first name, middle name(s) an
last name in that order in one cell.

I've seen formulas to extract the first or last word of a cell. 
I want to extract the first name and middle names, that is all word
except the last word (or last name).

Thank you for replying with the solution

--
Message posted from http://www.ExcelForum.com

0
2/25/2004 12:48:59 AM
excel.misc 78881 articles. 5 followers. Follow

6 Replies
389 Views

Similar Articles

[PageSpeed] 41

One way:


=LEFT(A1, FIND("^", SUBSTITUTE(A1,"_", "^", LEN(A1) - LEN(SUBSTITUTE(A1, 
"_", "")))) - 1)

where "_" represents a space (to prevent an unfortunate linewrap).

In article <bianling.125pzl@excelforum-nospam.com>,
 bianling <<bianling.125pzl@excelforum-nospam.com>> wrote:

> I'm sure that has been solved before, but I cannot find or figure out
> the right formula so far.
> 
> I have a column of cells that have the first name, middle name(s) and
> last name in that order in one cell.
> 
> I've seen formulas to extract the first or last word of a cell. 
> I want to extract the first name and middle names, that is all words
> except the last word (or last name).
> 
> Thank you for replying with the solution.
> 
> 
> ---
> Message posted from http://www.ExcelForum.com/
>
0
jemcgimpsey (6723)
2/25/2004 12:56:41 AM
Thank you for your quick reply.

unfortunately I copied and pasted your formula, but I only got #VALUE
I wouldn't have the knowledge to play with your formula.

What are some other ways/formulas you suggested this could be don
with?

Thank you

--
Message posted from http://www.ExcelForum.com

0
2/25/2004 8:40:59 PM
I tried it and it works. Are you sure that you put the whole formula in, the
posting wrapped it around despite John's efforts. Also, did you replace the
"_" by " "?

-- 

HTH

Bob Phillips
    ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"bianling >" <<bianling.127969@excelforum-nospam.com> wrote in message
news:bianling.127969@excelforum-nospam.com...
> Thank you for your quick reply.
>
> unfortunately I copied and pasted your formula, but I only got #VALUE.
> I wouldn't have the knowledge to play with your formula.
>
> What are some other ways/formulas you suggested this could be done
> with?
>
> Thank you.
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>


0
bob.phillips1 (6510)
2/25/2004 8:59:17 PM
Also be sure you don't have anyone entered with a space WITHIN their last name.  Something like John Charles Van Engel.  Most of the time this would be VanEngel but if someone entered it with a space tha tmight screw up what you are trying to do..

0
anonymous (74722)
2/25/2004 9:36:06 PM
Thank you again for your quick reply.

Your formula does work. I had moronically misunderstood how to edit th
space.

I am myself very impressed by the formula. Is there any chance you ca
explain a little bit what it does? For example what is the "^" use
for?

Thank you again

--
Message posted from http://www.ExcelForum.com

0
2/26/2004 2:38:22 AM
the caret (^) is just a character that is unlikely to be found in a name 
by itself. Substitute finds the last space and replaces the space with a 
caret. The Left function then uses Find() to find the caret, and return 
all the characters to the left .



In article <bianling.127ppw@excelforum-nospam.com>,
 bianling <<bianling.127ppw@excelforum-nospam.com>> wrote:

> I am myself very impressed by the formula. Is there any chance you can
> explain a little bit what it does? For example what is the "^" used
> for?
0
jemcgimpsey (6723)
2/26/2004 5:40:30 PM
Reply:

Similar Artilces:

Prevent clicking on a cell
I want to run the code below to prevent a range of cells from being selected if the Range("Q7") = 1. I have all cells on the worksheet locked but the user must be able to click on the locked cells to trigger a userform so I have to check Select Locked Cells. So is there any way make the Range("B5:C5") unselectable? If Range("Q7") = 1 Then Range("B5:C5").Locked = True End If Hi, >So is there any way make the > Range("B5:C5") unselectable? No but you can stop them staying there. Private Sub Worksheet_...

send the same e-mail with one or two fields changed.......
I would like to send the same e-mail to many differnet people with one or two fields changed (for example the name of recipient and the date).How canthis be done?? I would also like to be able to save the e-mail and use it again and again. can anyone help cheers john If you have Word installed and it's the same version as Outlook (both 2003, for example), you can do a mail merge between the two. This would allow you to set up the text the way you want it to, and you can save the document for future use. Look at the following page for further information: http://www.slipstick.com/con...

if cell is text move left one column
ColB is a long list with sections names followed by category codes I need to move the text into colA leaving colB with codes only (all numbers) ColB. Doors 940590 555998 447006 447008 810697 810705 810706 810707 Windows 619435 525691 525692 Try Sub Macro1() Dim lngRow As Long For lngRow = 1 To Cells(Rows.Count, "B").End(xlUp).Row If Not IsNumeric(Range("B" & lngRow)) Then Range("A" & lngRow).Value = Range("B" & lngRow).Text Range("B" & lngRow).Value = "" End If Next End Sub -- Jacob ...

punblisher and word prcoessing software
can publisher be used as word processing sofware? Not very successfully, it's a desktop publishing program. If you don't have the $, download and install OpenOffice. OpenOffice Writer is an excellent word processor — very similar to MS Word. "shelagh" <shelagh@discussions.microsoft.com> wrote in message news:834CE68F-4492-466A-91DC-694F807C578C@microsoft.com... > can publisher be used as word processing sofware? It *could* but it's not the best tool for that job. Specifically what do you want to do? -- JoAnn Paules Microsoft MVP - Publisher How to ask...

How do I extend a underline across an entire cell?
When working on a financial statement, I was curious how to 1. Have a line extend across an entire cell even if the number is only 2-3 digits and 2. How to apply a double line under a number without using the = sign in the following cell? Hi Lindsay Look on the formatting toolbar for Borders -- Regards Ron de Bruin http://www.rondebruin.nl "Lindsay" <Lindsay@discussions.microsoft.com> wrote in message news:F4C9ED6C-7F2D-4277-86CC-6FA46D315DA5@microsoft.com... > When working on a financial statement, I was curious how to 1. Have a line > extend across an entire ce...

Multiple domains on one Exchange server / All but one domain shows up as spam #2
I am sorry if this is on the board somewhere but I have been searching forever and havn't found a hint yet. I have multiple domains setup on my exchange server. Lets say abc.com, def.com, and hij.com. We only send email with @abc.com but can receive from any domain name. Recently we merged with another company and we brought back their email to our server, lets say xyz.com. Now I configured a new recipient on Exchange 2003, so I now have two policies. The first policy has the three original domains in it with @abc.com as the primary domain. In the second policy I have configured xyz.com t...

Starting an Office Program (word, excel) in Outlook to send email
I'm taking an Outlook 2002 class. The latest assignment requires I open a Microsoft app in Outlook to send an email. Troubleshooting so far: Have tried to install some addl features from CD, restarted the pc (O/S WINXP) but still get error "Cannot complete action". Get no reason why Outlook cannot perform this action and the HELP hasn't only points me to inserting an object or some variation thereof. My Outlook is configured to use with AOL 9.0. Steps (abbreviated) given in textbook to perform: Actions New mail using Microsoft Office Also tried to perform from Wo...

Separating Date and Time in a cell
I have a column of cells in the format "11/01/02 06:21". I would like to separate the text into 2 cells - one with the date and the other with the time. My attempts with LEFT and RIGHT have been unsuccesful. Thanks for your help Sameer --- Message posted from http://www.ExcelForum.com/ For the date use =INT(A1) replace A1 with the first cell of your range for time =MOD(A1,1) you probably have to reformat the first to mm/dd/yy (or whatever the setting is) and hh:mm Note that you can do this by just using format but if you want to compare to other cells with just pure d...

cell contents revert to 0 when i click on the next cell
I put a number into a cell click on the next cell and the first cell reverts to 0. If I format to number with 2 decimal places it will be ok but when I try to take out decimal places it goes back to zero, Help please You haven't said what number you are trying to put into the cell, but I suspect that the number is less than 0.5. A quick test shows that if you set the cell to no decimal places then enter a number less than 0.5 it is displayed 'rounded down' so it will show as zero, if it's 0.5 or above it displays as 1. If you need to put numbers less than 0.5 into youe c...

Accommodating for empty cells in this formula?
I have a formula in cell H21, for example, reads like this: =IF($G21<>"",($H20-$G21),"") is there a way to adjust the formula so that an empty cell in G21 doesn't give the #VALUE! in subsequent cells in column H? Just to give a similar example, this formula =SUMIF(A1:A9,"<>0") adjusts for any and all empty cells in A2 to A9. It no longer matters if any of the cells are empty, the formula correctly gives the correct addition of A1 plust a sum of everything between A2 to A10 without any #VALUE! results. Was hoping to have the formula above als...

how can i edit the positioning of the balloon comment in a word fi
how can i edit the positioning of the balloon comment in a microsoft word file ? please reply on my email What you can do is adjust the space reserved for the balloons in the margin. In Word 2007, on the Review tab, click Track Changes, and then click Change Tracking Options. Change the "Preferred width" setting. -- Stefan Blom Microsoft Word MVP "melikelmalik" <melikelmalik@discussions.microsoft.com> wrote in message news:80E5F3D3-04A0-4E81-B154-FA8459B25F00@microsoft.com... > how can i edit the positioning of the balloon comment in a mi...

Does any one know of a template for purchases, business card siz
I would like to be able to have a business card size card that I can punch the amount of purchase for my customers. After they make a certain amount of purchases I would collect them and they would receive a discount on their next purchase or a free item. On Sun, 7 Mar 2010 15:54:01 -0800, captured memories <captured memories@discussions.microsoft.com> wrote: >I would like to be able to have a business card size card that I can punch >the amount of purchase for my customers. After they make a certain amount of >purchases I would collect them and they would rece...

Automatic changes in cells
Hi for some reason I now have to save my work for any formlas etc to change when I update a worsheet, how can I stop this as it is a pain and sometimes I need to do changes to see how they work before saving the work. Many thanks Click on Tools | Options | Calculation tab and set to Automatic calculation, as it is probably set to Manual. You can press F9 to force a recalculation under a manual setting. Make sure you save the file with the Automatic setting, to avoid it happening next time. Hope this helps. Pete On Feb 1, 11:42=A0am, Office 2004 Test Drive User <heepenm...@yahoo.co.u...

Exchange server crashed, please help....! Need to restore two priv.edb and pub.edb files into one....!
Hi Guys, I was wondering if I could get some help with the following problem we are having on our company. Here is the scenario; Our Windows NT 4.0 SP4a server running Exchange 5.5 SP4 crashed (Server 1) due to the exchange database reaching its 16 Gig's max limit. I went ahead and moved some mailboxes' e-mails to a few .pst files in order to make some space. This worked ok. Then, I decided to build another exchange server (Server 2) to moved some mailboxes and alleviate the load. Once the server was ready and configured as part of the current exchange site, I went ahead and move...

cell colour change when set markers are reached
i need to get a cell to change colour when markers are reached eg a qualification lasts 12 months. what i want to do is have the cell change from yellow to orange to red as the expiry date gets closer. If column A contains expiry dates then select column A, Formats>Conditional Formatting>formula1: =DATEDIF(TODAY(),A1,"m")<1 red for 1 month Click Add button, formula2: =DATEDIF(TODAY(),A1,"m")<2 orange for 2 month Click Add button, formula3: =DATEDIF(TODAY(),A1,"m")<3 yellow for 3 month Adjust number of months as you like! Regards,...

Installed Font does not display in Word 2007
Only 6 of of 8 recently installed TTF fonts will display in Word 2007 Are the missing ones variants like Italic or Bold? On Dec 25, 1:28=A0pm, GWHA <G...@discussions.microsoft.com> wrote: > Only 6 of of 8 recently installed TTF fonts will display in Word 2007 ...

Word 2004 and kyocera printer issue
Hi, I am running a fully patched MAC OSX.4 machine with Office 2004 fully patched. I have installed the latest Kyocera OS X English 10.2 drivers from the kyocera website, for KM7530 model. The driver installs a job accounting feature in the printing presets for that particular printer. The function will work fine for every program other than word, word will not allow you the option to enter a pin code. all the features seem to be greyed out. If i reinstall and go immediately to anotherr program such as Eudora or Firefox or even Excel I can enter and lock the pin number in and it will print...

Calculating on alphabetic cell content
Hi, A selection of 4 different letters in a column representing different values to be used in a formula shall be run through. The calculated result of each cell in the column shall be placed in the cell next to the read one that holds the letter. Thanks in advance. Hi i think you're after the COUNTIF function with your column of letters in A1:A100 and the letter you're interested in in C1 then in D1 =COUNTIF(A1:A100,C1) this will count the number of times the value in C1 occurs in your range. If this isn't what you're after, could you type out a few examples of your ...

Removing text from cells leaving numbers (help with function)
I need a function that will remove all text from a cell and just leav numbers. Formatting cells to number does not work. For example if I have: (Sired] Tennessee 37013 (herein I just want 37013 left. Anybody know a function to resolve this -- Message posted from http://www.ExcelForum.com The following will strip the text from the active cell and place the number in the adjcent cell one column to the left. If there are subsequent numbers in the original string you will get erroneous results. Put the cursor on the cell to be processed and run the macro. ********************************...

when opening an excel file, 2 files open (one is book1)?
When I click on an excel file, 2 excel documents open up. One document is called Book1 and the other document is the actual document that I want to open. How do I stop this from happening? Brian To prevent Book1 from opening you can append /e to your shortcut for opening Excel. "C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\EXCEL.EXE" /e Alternative to the above............ Go to Start>Settings>Folder>Options>File Types. Scroll down to MS Excel Worksheet. Then if running Win98 OS Edit> select "Open" and Edit. If using WinXP OS you would scroll down to...

Sorting Cells by Colors
Hi all, Is it possible to write a VBA code to sort excel cells by colors, and the followed by other criterias, as in the normal sort? Thank you in advance. Hi SwiftCode, See Chip Pearson's Sorting By Color page at: http://www.cpearson.com/excel/SortByColor.htm --- Regards, Norman "swiftcode" <swiftcode@discussions.microsoft.com> wrote in message news:FC1550A7-A8DD-4EC0-B171-F1DB4373C35C@microsoft.com... > Hi all, > > Is it possible to write a VBA code to sort excel cells by colors, and the > followed by other criterias, as in the normal sort?...

searching a cell for a contained text word
Is it possible to search a cell for a key word or words contained in text made of multiple words enabling the user to than create a pivot table using the collected key word or words as data? Doug K ...

Question for Bob Phillips re Splitting Names from Cells
Bob You gave the answers below for splitting names from cells: =LEFT(A1,FIND("^^",SUBSTITUTE(A1," ","^^",LEN(A1)-LEN(SUBSTITUTE(A1, ",""))))-1) and =RIGHT(A1,LEN(A1)-FIND("^^",SUBSTITUTE(A1,"","^^",LEN(A1)-LEN(SUBSTITUTE(A1, ",""))))) Using these formulas on this example John A Doe results in John A an Doe, is it possible to split it to show John / A / Doe in 3 separat cells, I know I could use the formulas again on the John A result t split them but I'd like to do it in 1 go If possible could...

Duplicating one Field from One table to Another
Hi - I have two tables - one position, one personnel - which has a 1-to-many relationship (1 position record to many personnel records). The department had a new requirement which made it necessary to change some coding (I inherited this). I'm using tab forms so that when a position is pulled up, you can click on the tab that has the personnel information (if there is any). There is a button on the Personnel form that allows the user to add a new Personnel record. Since I am using an Auto-number field in the Position table (which doubles as the PK) the functionality is fine. Wh...

How do I create upper/lower case letters in cells?
I have a large spreadsheet with names/addresses that are all capitalized. I want to make them upper and lower case (SMITH = Smith). What's the formula? You could create helper cells with this formula =proper(A1) "boz130" wrote: > I have a large spreadsheet with names/addresses that are all capitalized. I > want to make them upper and lower case (SMITH = Smith). What's the formula? ...