Excel: VLOOKUP if Cell Contains Word within Text


You can use the following VLOOKUP formula to look up cells that contain a specific word within a text string:

=VLOOKUP("*"&A11&"*",A2:B8,2,FALSE)

This particular formula will look for the cell in the range A2:B8 that contains the word in cell A11 and return the corresponding value in the second column.

The following example shows how to use this formula in practice.

Example: VLOOKUP if Cell Contains Word within Text

Suppose we have the following dataset that shows the total sales made at various stores:

Now suppose we would like to look up the store that contains the word “Axel” and return the corresponding sales value.

We can use the following formula to do so:

=VLOOKUP("*"&A11&"*",A2:B8,2,FALSE)

The following screenshot shows how to use this formula in practice:

This VLOOKUP formula is able to look up “Axel” in the list of store names and return the correct sales value of 30.

Note that this formula is also case-insensitive.

This means that if we use “axel” then the formula will still be able to find this text in the list of store names:

The formula still returns the correct sales value of 30.

Additional Resources

The following tutorials explain how to perform other common operations in Excel:

Excel: How to Find Duplicates Using VLOOKUP
Excel: How to Use VLOOKUP to Return All Matches
Excel: How to Use VLOOKUP to Return Multiple Columns

2 Replies to “Excel: VLOOKUP if Cell Contains Word within Text”

  1. I am looking to do the same function but essentially flipped. In a data table with complex descriptions, I want to find a VLOOKUP match from another table. This is used for budgeting purposes. For example:
    AMAZON 12345 -> Merchandise
    AMAZON 23456 -> Merchandise
    AMAZON 34567 -> Merchandise

    I am looking to do this with multiple different entries, meaning that the complex descriptions may range from Amazon, Walmart, Kroger, etc.

    Are you able to assist?

    1. Hi Jake…

      What you’re trying to do is basically a reverse VLOOKUP. Instead of matching a full value exactly, you want to search for a keyword like Amazon, Walmart, or Kroger inside a longer description like “AMAZON 12345” and return a matching category like Merchandise or Groceries. This is really useful for budgeting, especially when transaction details come in different formats but follow a pattern.

      Here’s how you can set it up.

      Example Setup

      Imagine you have two tables in Excel.

      Table 1 has your full transaction descriptions, let’s say it’s on Sheet1:

      | A (Description) | B (Category) |
      | —————— | ——————- |
      | AMAZON 12345 | (formula goes here) |
      | WALMART STORE #999 | (formula goes here) |
      | KROGER 881122 | (formula goes here) |

      Table 2 is your list of keywords and the categories they should map to, located on Sheet2:

      | A (Keyword) | B (Category) |
      | ———– | ———— |
      | AMAZON | Merchandise |
      | WALMART | Merchandise |
      | KROGER | Groceries |
      | STARBUCKS | Dining |

      Now, what you want is a formula that checks if the description contains any of these keywords and returns the matching category.

      The Formula

      Paste this into cell B2 (next to your description in A2):

      “`
      =IFERROR(
      INDEX(Sheet2!B:B, MATCH(TRUE, ISNUMBER(SEARCH(Sheet2!A:A, A2)), 0)),
      “No Match”
      )
      “`

      This formula does the following:

      * SEARCH looks through all your keywords to see if any of them are found inside the transaction description.
      * ISNUMBER converts the result into TRUE or FALSE depending on whether it found a match.
      * MATCH(TRUE, …) finds the position of the first match.
      * INDEX returns the corresponding category from your mapping table.
      * IFERROR gives you a friendly label like “No Match” if nothing is found.

      Some things to keep in mind:

      If you’re using an older version of Excel, like anything before Excel 365 or Excel 2021, you need to press Ctrl + Shift + Enter when entering this formula. In newer versions, just press Enter.

      You might also want to narrow the range from Sheet2!A\:A to something like Sheet2!A2\:A20 to make it faster, especially if you’re working with a large dataset.

Leave a Reply

Your email address will not be published. Required fields are marked *