Forum Discussion

JRink99's avatar
JRink99
Copper Contributor
Jan 02, 2025
Solved

Searching for multiple words in an Excel spreadsheet (ugh, why is this so hard?)

I know that I can search for words in Excel using CTRL-F.    However, I have an Excel spreadsheet that I regularly need to search for roughly 40 keywords, and I need to do that on a weekly basis as t...
  • HansVogelaar's avatar
    HansVogelaar
    Jan 06, 2025

    I created a sheet named Data with some sentences in cells in several rows/columns.

    I also created a sheet named Keywords with a range of words in A2:A18 - in your real workbook, that would extend to A41 or so.

    I selected this range, clicked in the Name/Address box on the left hand side of the formula bar, typed the name Keywords and pressed Enter. This names the range with the keywords.

    In cell C2 on the Keywords sheet, I entered the formula

    =FILTER(Keywords, COUNTIF(Data!A1:Z100, "*"&Keywords&"*"), "-none-")

    This range looks at the Keywords range, and returns only the items that satisfy the condition that

    COUNTIF(Data!A1:Z100, "*"&Keywords&"*")

    returns a non-zero value. If none of the keywords satisfy the condition, "-none-" is returned.

    COUNTIF(Data!A1:Z100, "*"&Keywords&"*") looks at the range Data!A1:Z100 - you can expand or shrink this as you like. It counts the number of cells in this range that contain a keyword, plus possibly other text: "*" is a wildcard that stands for any number of characters (including none).

     

    An alternative would be to highlight the keywords that occur on the Data sheet - see the attached version. I created a Conditional Formatting rule for the Keywords range.

Resources