+ Reply to Thread
Results 1 to 15 of 15

Formula to find specific text in a cell from a reference table?

  1. #1
    Registered User
    Join Date
    03-20-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    6

    Formula to find specific text in a cell from a reference table?

    Can someone help me with a formula to search the contents of each cell for specific text from a reference table?

    Eg.
    cell A1: EFTPOS COLES WATERLOO NSW AU
    cell A2: EFTPOS DANKS ST PHARMACY 0001 WATERLOO
    cell A3: EFTPOS COLES WATERLOO NSW AU
    cell A4: EFTPOS THE REJECT SHOP EAST PAGEWOOD NS
    cell A5: EFTPOS HANDYWAY AVENUE ON 0001 SYDNEY

    Reference table
    COLES
    REJECT
    AVENUE


    Essentially I want to put a formula in each cell that searches A1, A2 etc for any of the words in the reference table below & the result is to put that word in cell B1 (COLES), B2 (n/a), B3 (COLES), B4 (REJECT), B5 (AVENUE) etc

    Can someone suggest a simple way of doing this?

    Thanks

  2. #2
    Registered User
    Join Date
    02-29-2012
    Location
    India, Bangalore
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    21

    Re: Formula to find specific text in a cell from a reference table?

    Hi, I think you can use search function
    =Search(Find Text, Within Text, Start_num) where it can find the actual start number in an text.
    If it returns with any number then you can identify that the text contains the refered text.

    Sorry i think this will not help you.. Will be back with another solution...
    Last edited by TAMILARASAN; 03-20-2012 at 03:21 AM.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formula to find specific text in a cell from a reference table?

    Hi and welcome to the forum.

    Try this formula in B1 and copy down. Also change the semi-colons to gomma, if you have to do it.

    =IF(ISERROR(FIND("COLES";A1;1));IF(ISERROR(FIND("REJECT";A1;1));IF(ISERROR(FIND("AVENUE";A1;1));"";"AVENUE");"REJECT");"COLES")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    02-29-2012
    Location
    India, Bangalore
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    21

    Re: Formula to find specific text in a cell from a reference table?

    Hi i think this may help you. Pls try out the below solution & also the attached reference file
    =MID(A5,FIND(C5,A5,1),LEN(C5))
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-20-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Formula to find specific text in a cell from a reference table?

    Quote Originally Posted by TAMILARASAN View Post
    Hi i think this may help you. Pls try out the below solution & also the attached reference file
    =MID(A5,FIND(C5,A5,1),LEN(C5))
    Thanks - this was not really what I was looking for. I want to have the options "Coles, Reject" etc in a dropdown list that I can reference to so that the formula in each line finds the content. (not sure if that makes sense). I think the previous solution works for me.

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formula to find specific text in a cell from a reference table?

    Did you test my suggestion???

  7. #7
    Registered User
    Join Date
    03-20-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Formula to find specific text in a cell from a reference table?

    Quote Originally Posted by Fotis1991 View Post
    Hi and welcome to the forum.

    Try this formula in B1 and copy down. Also change the semi-colons to gomma, if you have to do it.

    =IF(ISERROR(FIND("COLES";A1;1));IF(ISERROR(FIND("REJECT";A1;1));IF(ISERROR(FIND("AVENUE";A1;1));"";"AVENUE");"REJECT");"COLES")
    Hi Fotis1991 - this is great.

    One other question - can I point the fields I want to lookup to a list or range, rather than using the lookup names (avenue, reject, coles etc) in the formula.
    Reason I ask is that my example had only 3 items, but in reality I may have 30 items in my reference field I want looked up & if I used 30 items in the formula it will get so big & unmanageable.

    thanks

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formula to find specific text in a cell from a reference table?

    You mean, something like this??

    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Contributor darknation144's Avatar
    Join Date
    01-24-2012
    Location
    London
    MS-Off Ver
    Microsoft Excel 365 MSO
    Posts
    555

    Re: Formula to find specific text in a cell from a reference table?

    Please mark this as solved if you have received a satisfactory answer.

  10. #10
    Registered User
    Join Date
    03-20-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Formula to find specific text in a cell from a reference table?

    Quote Originally Posted by Fotis1991 View Post
    You mean, something like this??

    Please Login or Register  to view this content.
    Thanks Fortis. It sort of helps - perhaps I am not explaining properly.
    What you have proposed works, but the number of arguments I can use in the formula seem to be limited to 6 or 7.

    - From the attachement, there is a large list of data in Column A.
    - What I would like to do, it put a formula against each row of data in Col D.
    - This forumula should identify if any of the words in I1:I16 are found in each row of Col A & if it finds that word in the text string, I would like to see that word as the result in Col D.

    So what you proposed works, but I need to use a much longer list of keys words & dont want to be limited to 6.
    Hopefully this clarifies.
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Formula to find specific text in a cell from a reference table?

    Try...

    =IFERROR(LOOKUP(9E300,SEARCH(I$1:I$16,A1),I$1:I$16),"")

    copy down
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formula to find specific text in a cell from a reference table?

    Hi

    ...perhaps I am not explaining properly.
    Don't be so sure for this... As you understand, my English are not so good....

    So, try this version..

    Please Login or Register  to view this content.



    Note: As i work in Excel 2003, i can not "test" Haseeb's suggestions, that is mutch shorter.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    03-20-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Formula to find specific text in a cell from a reference table?

    Fortis & Haseeb - thanks for the help. Both solutions work

  14. #14
    Registered User
    Join Date
    03-20-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Formula to find specific text in a cell from a reference table?

    Haseeb, what is the reference in the Lookup formula below pointing at or what does it mean: 9E300 ?

    Quote Originally Posted by Haseeb A View Post
    Try...

    =IFERROR(LOOKUP(9E300,SEARCH(I$1:I$16,A1),I$1:I$16),"")

    copy down

  15. #15
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Formula to find specific text in a cell from a reference table?

    @larrens:

    as per my understanding - 9E300 indicates a ridiculously large value. it could have been 2^15 (as in @Fotis's formula) or 99^99, all the same. the idea is to establish a 'most-out-there' value.

+ 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