Function Problems

Match a Cell Against Comma-Separated Values in Excel

Nimra MalikNimra Malik Dec 2, 2026 868 views

Question details

Find a cell value as a complete item in another cell's comma-separated list and return the value when it matches.

Match a Cell Against Comma-Separated Values in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A value in column A must be checked against a comma-separated list in column B for each row.
Observed behavior
The formula should return the matching value without matching part of a longer list item.
Before you start

Check whether the items in column B are separated by commas alone or by commas followed by spaces. Place the formula in an empty column so it does not overwrite the list.

Solution 1Recommended

Use FIND to match a complete comma-separated item

Add delimiters around the search value and list so Excel matches a whole item rather than part of one.

These formulas are case-sensitive and assume list items do not contain commas. Use the formula that matches the spacing in your list.

1
Enter the formula

In C2, enter =IF(A2="","",IF(ISNUMBER(FIND(","&A2&",",","&B2&",")),A2,"")) for a comma-only list such as apple,pear,plum.

2
Adjust for comma-space lists

If B2 uses a comma followed by a space, such as apple, pear, plum, enter =IF(A2="","",IF(ISNUMBER(FIND(", "&A2&",",", "&B2&",")),A2,"")) in C2 instead.

3
Fill down

Select C2 and drag its fill handle down to apply the formula to the remaining rows. A match returns the value from column A; no match returns an empty string.

Use FIND to match a complete comma-separated item
Check spacing: The list must use the chosen separator consistently, and extra spaces around individual values can prevent a match.
Work with spreadsheets in WPS Office

Match comma-separated values in WPS Spreadsheets

Use the same delimiter-based FIND formula in WPS Spreadsheets to return complete list matches without partial matches.

  1. 1. Open the spreadsheet: Open WPS Spreadsheets and select Menu > Open to load your workbook.
  2. 2. Check the list separator: Look at the values in column B and determine whether they use commas alone or commas followed by spaces.
  3. 3. Enter the matching formula: For comma-only lists, select C2 and enter =IF(A2="","",IF(ISNUMBER(FIND(","&A2&",",","&B2&",")),A2,"")). For comma-space lists, enter =IF(A2="","",IF(ISNUMBER(FIND(", "&A2&",",", "&B2&",")),A2,"")) instead.
  4. 4. Apply the formula to other rows: Select C2 and drag the fill handle down through the rows you want to check.
Match complete items in comma-separated listsOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and fill handlesWork with a free, easy-to-use office suite
microsoft office alternative - wps office

Frequently Asked Questions

How does the formula prevent partial matches?

It adds commas around both the search value and the list before using FIND. For example, searching for ,apple, will not match the item pineapple.

Can I match values without considering capitalization?

Yes. Replace FIND with SEARCH in the formula. SEARCH is case-insensitive, while the surrounding commas still restrict the match to a complete item.

Why is a value not matching when it appears in the list?

Check that you selected the formula for the list's separator and that there are no extra spaces around the value in A2 or the list items in B2. FIND also requires matching capitalization.

What happens if the search cell is empty?

The outer IF(A2="","",...) returns an empty string, so a blank search cell does not produce a match.