+ Reply to Thread
Results 1 to 10 of 10

How to extract numerical value after certain strings within a cell?

  1. #1
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    How to extract numerical value after certain strings within a cell?

    I have an Excel worksheet that includes 3 different numbers in a single cell along with specific text as shown in this spreadsheet:

    Excel Sample 2016-01-13.xlsx

    I need to put the 1st, 2nd, and 3rd numbers in different cells (in columns G, H, and I, respectively).

    I'd really appreciate any help.

    Thanks!

    Rob

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

    Re: How to extract numerical value after certain strings within a cell?

    In G2 Cell

    =IFERROR(LEFT($F2,FIND(" ",$F2)-1),"")


    In H2 Cell

    =IFERROR(TRIM(LEFT(MID($F2,FIND("redactions on ",$F2)+LEN("redactions on "),255),FIND(" ",TRIM(MID($F2,FIND("redactions on ",$F2)+LEN("redactions on "),255))))),"")


    In I2 Cell

    =IFERROR(TRIM(LEFT(TRIM(MID(MID($F2,FIND("redactions on ",$F2)+LEN("redactions on "),255),FIND("redactions on ",MID($F2,FIND("redactions on ",$F2)+LEN("redactions on "),255))+LEN("redactions on "),255)),FIND(" ",TRIM(MID(MID($F2,FIND("redactions on ",$F2)+LEN("redactions on "),255),FIND("redactions on ",MID($F2,FIND("redactions on ",$F2)+LEN("redactions on "),255))+LEN("redactions on "),255)))-1)),"")


    Drag all the formula's down


    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 Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How to extract numerical value after certain strings within a cell?

    Try

    G2=IFERROR(LEFT(F2,FIND(" ",F2)-1),"")+0

    L2=LEFT(MID(F2,FIND("on ",F2)+3,250),FIND(" ",MID(F2,FIND("on ",F2)+3,250))-1)+0

    M2=LEFT(TRIM(RIGHT(SUBSTITUTE(F2," ",REPT(" ",50)),101)),FIND(" ",TRIM(RIGHT(SUBSTITUTE(F2," ",REPT(" ",50)),101)))-1)+0

    Drag down all the formula as per your requirement.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  4. #4
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: How to extract numerical value after certain strings within a cell?

    Sixthsense, you rock! Thank you!

    Quick add-on question (because frankly, I don't understand what your 2nd and 3rd formulas are doing at all):
    If I added the following text to the very end of some of the cells in column F: Excerpt(X), where X is another number, would it screw up either of your two other formulas? How would I add the number X to yet another cell?

    Thanks again! You saved me--I think the rest of my hair might be safe for tonight (I can stop pulling it out).

    Rob

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

    Re: How to extract numerical value after certain strings within a cell?

    Quote Originally Posted by robbyvegas View Post
    If I added the following text to the very end of some of the cells in column F: Excerpt(X), where X is another number, would it screw up
    I hope shukla.ankur281190 will cover your addition since his approach is smarter than my suggested solution.

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How to extract numerical value after certain strings within a cell?

    @Sixthsense Guru thanks for appreciate my solution.

    @Rob can you put some example here so that i can understand what you actually want to do further.

    Thanks
    Ankur Shukla

  7. #7
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: How to extract numerical value after certain strings within a cell?

    Quote Originally Posted by shukla.ankur281190 View Post
    @Sixthsense Guru thanks for appreciate my solution.

    @Rob can you put some example here so that i can understand what you actually want to do further.

    Thanks
    Ankur Shukla
    Thanks! I already put in most of @Sixthsense 's solution, but I'm happy to change it. Here is a sample.

    Thanks again!Excel Sample 2016-01-13.xlsx

  8. #8
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How to extract numerical value after certain strings within a cell?

    Try

    H2=IFERROR(TRIM(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(F2,"(",REPT(" ",50)),50)),")",""))+0,0)

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    02-11-2010
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: How to extract numerical value after certain strings within a cell?

    Awesome. Perfect. Thank you!

  10. #10
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: How to extract numerical value after certain strings within a cell?

    Thanks for feedback and Rep !!! Hppy to help you

    Please mark as it solved now.

+ 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 extract strings from hyphen separated strings
    By sharathnarayanan in forum Excel General
    Replies: 5
    Last Post: 11-22-2014, 10:01 AM
  2. Vba macro to extract (numbers & strings) from cell -Regex
    By zeekad in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-11-2014, 04:33 AM
  3. [SOLVED] How to extract strings from cell...and add them on new line.
    By SWMagic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-19-2013, 05:39 PM
  4. Extract specific strings within a cell macro
    By ardniw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2013, 03:41 AM
  5. extract date from cell with other strings
    By danusko in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-22-2008, 09:56 AM
  6. Extract strings intelligently from single cell
    By berny99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2008, 11:30 PM
  7. Extract one numerical value from single cell with multiple values?
    By cszy67 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-26-2005, 09:49 PM

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