+ Reply to Thread
Results 1 to 10 of 10

Search text in range, if matches, return match value

  1. #1
    Forum Contributor
    Join Date
    08-07-2014
    Location
    London
    MS-Off Ver
    10
    Posts
    148

    Search text in range, if matches, return match value

    Hi all,

    Any help on this would be appreciated. As per the title of my request. I wonder if anyone knew of a formula which would allow me to search a range of cells against a single cell and then return any value that matches.

    Thanks all.
    Last edited by ShakJames; 09-13-2016 at 09:39 AM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Search text in range, if matches, return match value

    Vlookup
    index(...mjatch)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    08-07-2014
    Location
    London
    MS-Off Ver
    10
    Posts
    148

    Re: Search text in range, if matches, return match value

    Hi Special-K,

    Thanks for the reply. These don't quite fit the bill because the cell which is being used to match against the range has quite a bit of data in it, so I almost need the formula to search the cell and match if the value is in the range.

    I think that make sense! Sorry, I also realise that a bit more info in my original post would have been helpful.

    So lets say the below is the cell:

    Please Login or Register  to view this content.
    The range is List as per the below:
    • AFA
    • GHA
    • ADD
    • FFA

    Once searched, I want it to return AFA, once the match is done.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Search text in range, if matches, return match value

    Try this ...

    =LOOKUP(2,1/FIND(List,A1),List)

  5. #5
    Forum Contributor
    Join Date
    08-07-2014
    Location
    London
    MS-Off Ver
    10
    Posts
    148

    Re: Search text in range, if matches, return match value

    Thanks for the reply, Phuocam. Much appreciated.

    It just brings up a "0". I've put the code in as:

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Search text in range, if matches, return match value

    List is range F1:F5

    =LOOKUP(2,1/FIND('Source Data'!$F$1:$F$5,D2),'Source Data'!$F$1:$F$5)

    Not F:F.

  7. #7
    Forum Contributor
    Join Date
    08-07-2014
    Location
    London
    MS-Off Ver
    10
    Posts
    148

    Re: Search text in range, if matches, return match value

    Hi,

    Thanks for that, I just realised! It works brilliantly.

    However, It does still up an issue for me. The list is likely to expand, at the moment is it has 350 entries, but the about won't let me put, for example 'Source Data'!$F$1:$F$1000' to allow for expansion.

    Is there any way around this?

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Search text in range, if matches, return match value

    Alt+F3 -> Name manager -> New

    Name -> List

    Refers to: =OFFSET($F$1,,,COUNTA($F:$F),)

    Formula:

    =LOOKUP(2,1/FIND(List,A1),List)

  9. #9
    Forum Contributor
    Join Date
    08-07-2014
    Location
    London
    MS-Off Ver
    10
    Posts
    148

    Re: Search text in range, if matches, return match value

    That's worked a dream.

    Just before your message I tried the name manager method but was putting the name of the list in quotes, so it wasn't working, so I gave up on it, but your message corrected my mistake.

  10. #10
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Search text in range, if matches, return match value

    You're welcome!

+ 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] Search and return text that matches a reference
    By JSTR250 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 12-24-2015, 05:28 AM
  2. Search for a match of a text within text string and return initial value
    By orehovka in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-23-2015, 06:48 AM
  3. Replies: 2
    Last Post: 09-12-2015, 11:02 AM
  4. Search a table with multiple search inputs and return all matches
    By JDI in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-16-2014, 12:23 PM
  5. Replies: 3
    Last Post: 06-17-2013, 01:09 PM
  6. Search named range for multiple matches to critera and return date & values
    By a.mack123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2011, 10:07 AM
  7. Search text string for range of text values - return match
    By crugg in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-03-2010, 09:55 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