Question: How do I search a list for two text strings and return a list with where both strings occurs?

Answer: Here is a formula (F2:F4) that creates a list with text values where both strings occur and is not case-sensitive.

Array formula in F2:F4

=INDEX(Text_col, SMALL(IF(FREQUENCY(IF(ISERR(SEARCH(TRANSPOSE(Search_col), Text_col)), "", ROW(Text_col)-MIN(ROW(Text_col))+1), ROW(Text_col)-MIN(ROW(Text_col))+1)=ROWS(Search_col), ROW(Text_col)-MIN(ROW(Text_col))+1, ""), ROW(1:1))) + CTRL + SHIFT + ENTER copied down as far as needed.

How to implement this formula to your excel worksheet

Change named ranges

Named ranges

Text_col (A2:A12)
Search_col (D2:D3)
What is named ranges?

How to increase the number of search strings

Change the cell reference for the named range Search_col.

Download excel example file

Search-for-multiple-strings-in-multiple-cells.xls
(Excel 97-2003 Workbook *.xls)

Functions in this article:

IF(logical_test;[value_if:true];[value_if_false])
Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE

INDEX(array,row_num,[column_num])
Returns a value or reference of the cell at the intersection of a particular row and column, in a given range

ROW(reference) Returns the rownumber of a reference

ROWS(array) returns the number of rows in a reference or an array

SMALL(array,k) Returns the k-th smallest row number in this data set.

SEARCH() Returns the number of the character at which a specific character or text string is first found, reading left to right (not case sensitive)

FREQUENCY(data_array, bins_array)
Calculates how often values occur within a range of values and then returns a vertical array of numbers having one more element than Bins_array.

TRANSPOSE(array)
Converts a vertical range to a horizontal range, or vice versa.

Read more articles about this topic:

Read more Excel – Search/Lookup

  • Share/Bookmark

Related posts:

  1. Search for multiple text strings in multiple cells and use in data validation in excel
  2. Search for multiple text strings in multiple cells in excel, part 2
  3. Search and display all cells that contain all search strings in excel
  4. Lookup with multiple criteria and display multiple search results using excel formula, part 3
  5. Lookup with multiple criteria and display multiple search results using excel formula, part 4
  6. Lookup with multiple criteria and display multiple search results using excel formula, part 2
  7. Search for a text string in an excel table
  8. Lookup with multiple criteria and display multiple search results using excel formula
  9. Lookup values in a range using two or more criteria and return multiple matches in excel
  10. Search and display a range of values in excel