index match wildcard multiple search across a table

shakethingsup

New Member
Joined
May 21, 2017
Messages
34
Hello - I've been searching the boards and the web. I can't seem to get the logic and put things together. I can't find the thread or a web page. Perhaps I'm searching the wrong terminology.

I want to have partial/wildcard search capabilities. I know I'm making this more complicated than I need to.

The formula I'm using is probably too long as eventually I will need to search across a table with 20 columns. Also, for the most part, I think there won't be any similarities between columns. For example, I don't think there will be a chance that column B will have a value of Hello and column C will have a value of Helium. I mean if I can build this into the formula that would be great.

When I checked the output of each function, everything seemed okay:

=INDEX(A2:A6,MATCH(F1,(IFERROR(MATCH(F1&"*",B2:B6,0),0)+IFERROR(MATCH(F1&"*",C2:C6,0),0)),0))
=INDEX({"audit";"t3010";"sri";"due";"telephone"},Match(He,5,0))




 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,327
Try this

=INDEX(A2:A6,MAX(IF(ISNUMBER(SEARCH(F1,B2:C6)),ROW(A2:A6)-ROW(A2)+1)))
Array formula, use Ctrl-Shift-Enter

This will search for F1 across columns B1 and C1 and using the relevant row will get the value from column A
You should be able to search multiple columns with this formula.

NOTE: If the search value does not exist it will return the value at A2
If the search data is repeatd you'll only get the last row, e.g. you search for e, but its in "due" and "telephone" youll only get telephone as a result.
Basically make sure your search data is not repeated.
 
Last edited:

shakethingsup

New Member
Joined
May 21, 2017
Messages
34
Try this

=INDEX(A2:A6,MAX(IF(ISNUMBER(SEARCH(F1,B2:C6)),ROW(A2:A6)-ROW(A2)+1)))
Array formula, use Ctrl-Shift-Enter

This will search for F1 across columns B1 and C1 and using the relevant row will get the value from column A
You should be able to search multiple columns with this formula.

NOTE: If the search value does not exist it will return the value at A2
If the search data is repeatd you'll only get the last row, e.g. you search for e, but its in "due" and "telephone" youll only get telephone as a result.
Basically make sure your search data is not repeated.

This seems like it worked. I'm going to try and understand more of the logic and break it down.

thank you!
 
Last edited:

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,327
I wish I could help, it's not my formula, I just modified the search part of it to a partial search

Its part of something described as a "reverse two way lookup".
This is where youre searching a table for a value and want to know what row and column it's in, you cant have duplicates in the table.
 
Last edited:

Forum statistics

Threads
1,082,297
Messages
5,364,373
Members
400,793
Latest member
hamzayagiz

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top