+ Reply to Thread
Results 1 to 7 of 7

Formula to get the middle word

  1. #1
    Forum Contributor
    Join Date
    09-09-2012
    Location
    Manila,Philippines
    MS-Off Ver
    Excel 2003
    Posts
    153

    Formula to get the middle word

    Hi,

    Can someone help me to come up with the formula to get the middle word for this example:

    0001 AB10846 Group Assoc NetAdmn
    0001 AB10854 Indv Func NetAdmn
    .
    ..
    ... and so on.

    For the 2nd word I have this formula:

    =TRIM(IF(ISERROR(FIND(" ",C1,1)),C1,MID(C1,FIND(" ",C1,1)+1,IF(ISERROR(FIND(" ",C1,FIND(" ",C1,1)+2)),LEN(C1),FIND(" ",C1,FIND(" ",C1,1)+2))-FIND(" ",C1,1))))

    And now I need to get the 3nd and 4th word separately.

    I appreciate your help.

    Thanks!

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Formula to get the middle word

    In A1 Cell

    0001 AB10846 Group Assoc NetAdmn

    In B1 Cell

    =IFERROR(REPLACE(REPLACE(A1,1,FIND(" ",A1,FIND(" ",A1)+1),""),FIND(" ",REPLACE(A1,1,FIND(" ",A1,FIND(" ",A1)+1),"")),5^5,""),"")


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    09-09-2012
    Location
    Manila,Philippines
    MS-Off Ver
    Excel 2003
    Posts
    153

    Re: Formula to get the middle word

    Hi!

    How about getting the 4th word "Assoc"? My apologies as I am not that expert in complex formulas...

    Thanks!

  4. #4
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Formula to get the middle word

    Assuming that your number in a1 cell
    B1 =MID(SUBSTITUTE(SUBSTITUTE(" "&$A1&" "," ","#",COLUMN()-1)," ","$",COLUMN()-1),1+FIND("#",SUBSTITUTE(SUBSTITUTE(" "&$A1&" "," ","#",COLUMN()-1)," ","$",COLUMN()-1)),FIND("$",SUBSTITUTE(SUBSTITUTE(" "&$A1&" "," ","#",COLUMN()-1)," ","$",COLUMN()-1))-FIND("#",SUBSTITUTE(SUBSTITUTE(" "&$A1&" "," ","#",COLUMN()-1)," ","$",COLUMN()-1))-1)
    then drag right

    Mine is not efficient as Sixthsense's solution but its just an alternative.
    Appreciate the help? CLICK *

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Formula to get the middle word

    Just added another find within the find function

    =IFERROR(REPLACE(REPLACE(A1,1,FIND(" ",A1,FIND(" ",A1,FIND(" ",A1)+1)+1),""),FIND(" ",REPLACE(A1,1,FIND(" ",A1,FIND(" ",A1,FIND(" ",A1)+1)+1),"")),5^5,""),"")

  6. #6
    Forum Contributor
    Join Date
    09-09-2012
    Location
    Manila,Philippines
    MS-Off Ver
    Excel 2003
    Posts
    153

    Re: Formula to get the middle word

    Hi Everyone!

    Thanks all for your help it works.

    Warm Regards,

    Hype19

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Formula to get the middle word

    Another way.....

    Assuming you have text string in the cell C1, then in D1 place the below formula and drag across to F1

    Please Login or Register  to view this content.
    Hope that helps.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to convert First, Middle, Last name to Last, First Middle Initial with VBA
    By lwine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-30-2013, 03:33 PM
  2. Extracting the Middle Initial/Middle Name
    By akwishestofish in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-16-2012, 11:13 AM
  3. [SOLVED] Copying a word from one cell in a different worksheet into the middle of a sentence.
    By DannyJ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-25-2012, 11:18 AM
  4. Sort by middle word?
    By brotherwo in forum Excel General
    Replies: 6
    Last Post: 03-10-2011, 05:58 PM
  5. Rounding Up in the middle of a formula
    By auntsally in forum Excel General
    Replies: 3
    Last Post: 07-12-2008, 08:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1