+ Reply to Thread
Results 1 to 9 of 9

extracting values in a specific text

  1. #1
    Forum Contributor
    Join Date
    07-20-2009
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    203

    extracting values in a specific text

    Sigh, , I found some bug in my worksheet, and i think you people were the only one who can help me with this..


    This how it looks like, i used this code (see below) to get the amount if there is a word "ins" (martin's code)




    IF(AND(ISNUMBER(SEARCH("ins",B47)),NOT(ISNUMBER(SEARCH("insp",B47)))),LOOKUP(99^99,--("0"&MID(B47,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},B47&"0123456789")),ROW($1:$10010))))+0,""))


    it works pretty great, but when things getting better, i've encounter this data: 12,300 ins 09-10 flood

    so what i did, is to put another if function, like this:



    =IF(AND(ISNUMBER(SEARCH("flood",B47))),"",IF(AND(ISNUMBER(SEARCH("ins",B47)),NOT(ISNUMBER(SEARCH("insp",B47)))),LOOKUP(99^99,--("0"&MID(B47,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},B47&"0123456789")),ROW($1:$10010))))+0,""))

    and cool! it's working! but.. again another bad data i've encounter ->>> "12,300 ins flood, fire" also "12,300 ins flood, fire, wind".


    and now, my head is spinning around, i don't know what to do.. help me guys..

    Thanks...
    Last edited by darkhangelsk; 08-18-2009 at 10:57 AM.

  2. #2
    Forum Contributor
    Join Date
    07-20-2009
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    203

    Re: extracting values in a specific text

    anyone guys?


    is this impossible to do?, any ideas or suggestions will be accepted... pls?!

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: extracting values in a specific text

    We are not familiar with the original requirements and your current dilema... can you please elaborate as if it were a new topic....
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  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: extracting values in a specific text

    i just realised its easier to do it like this
    =IF(OR(ISNUMBER(SEARCH({"flood","fire","water","insp"},B47))),"",IF(ISNUMBER(SEARCH("ins",B47)),LOOKUP(99^99,--("0"&MID(B47,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},B47&"0123456789")),ROW($1:$10010))))+0,""))
    just add any words that may have "ins" associated with them to
    {"flood","fire","water","insp"}
    "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

  5. #5
    Forum Contributor
    Join Date
    07-20-2009
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    203

    Re: extracting values in a specific text

    ahh okay...


    in a1 i have a data like this -> "12,300 ins 09-10, fire,flood,wind" and in b2 i want to return only the value has the word "ins", and also in c3 i want to get only the value if the word contains "fire" and so on... but they are diferrent,

    fire,flood,wind should be under "fire/flood/wind", not b2 which is only "ins" or c3 for fire.. i attached an example to make this clear..
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    07-20-2009
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    203

    Re: extracting values in a specific text

    oops my previous post is for NVBC, but ofcourse martin understood what my problem is,.. i'll try this martin, and close this if i don't have any question. Thanks!!!

  7. #7
    Forum Contributor
    Join Date
    07-20-2009
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    203

    Re: extracting values in a specific text

    martin, i got an error of #name? <---- if the word is 253.00 ins, i think i copied it correctly but still the error appears...

  8. #8
    Forum Contributor
    Join Date
    07-20-2009
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    203

    Re: extracting values in a specific text

    i saw the problem, you put space in LOOKUp function,.

    again this is very useful.. thank you!

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

    Re: extracting values in a specific text

    post your latest sheet ,but i see on posting its put a space in the middle of posting its put a space in LOOKUP i.e. LOOK UP get rid of that space

+ 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