+ Reply to Thread
Results 1 to 4 of 4

Extract Data from Middle of Cell

  1. #1
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Extract Data from Middle of Cell

    I have a table, and in Col E, I need to extract a value from the middle of a cell.

    Cell E2 =
    Please Login or Register  to view this content.
    I need a result that gives me
    Please Login or Register  to view this content.
    .

    The beginning of the field will always have
    Please Login or Register  to view this content.
    , but the value I'm trying to extract will either be 4 or 5 digits in length. So I don't know how to write a mid formula in my macro to do that.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extract Data from Middle of Cell

    one way
    =SUBSTITUTE(MID(A1,FIND("+",A1)+1,255),"p)","")+0
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor
    Join Date
    05-13-2009
    Location
    Lincoln, IL
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    237

    Re: Extract Data from Middle of Cell

    That worked. Now let me ask this. Some cells don't have this (+7.33p) piece. So now I need to incorporate this substitute formula into a larger formula.

    Please Login or Register  to view this content.
    To make matters more complicated Col E is text. So when I try to convert this to a number, it works fine except for the (+7.33p) cases where it results in #VALUE. So I don't know how to write my if formula to do all this. I'm attaching the file.

    I'm wanting to put the results in a new col between E and F.
    Attached Files Attached Files

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Extract Data from Middle of Cell

    =IF(ISNUMBER(E2+0),E2+0,SUBSTITUTE(MID(E2,FIND("+",E2)+1,255),"p)","")+0)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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