Function Problems

How to Compare Comma-Separated Strings and Mark Data in Excel

Steve KSteve K Nov 10, 2026 868 views

Question details

The user needs to automate an Excel process to compare comma-separated strings across two columns, find mutual citations, look up their application years, and mark the older related patents for deletion.

How to Compare Comma-Separated Citation Strings and Mark Earlier Patents in Excel
Product
Excel
Device & OS
not provided
Scenario
Data analysis of patent citations requiring complex string manipulation, array comparison, and conditional row marking.
Observed behavior
Currently, the user has comma-separated strings in backward and forward citation columns and needs a formula-based workflow to extract matches, retrieve years, and flag older entries automatically.
Before you start

Ensure you are using a modern version of Excel or WPS Spreadsheet that supports dynamic array formulas like TEXTSPLIT and XLOOKUP, as these are essential for splitting strings and retrieving data efficiently.

Solution 1Recommended

Use Dynamic Array Formulas to Compare and Mark Patents

Combine TEXTSPLIT to break comma-separated strings into arrays, use XLOOKUP to fetch matching years, and apply an IF statement to flag older patents.

This method leverages modern spreadsheet functions to handle comma-separated lists within a single cell, cross-reference them, and apply conditional logic without needing VBA macros.

1
Split and match the citation strings

In column E, use the TEXTSPLIT function to break the comma-separated strings from the backward and forward citation columns into arrays. Combine this with a filtering function like FILTER or XMATCH to compare the two arrays and return the mutual citation.

2
Look up the application year

In column F, use the XLOOKUP function. Set the extracted citation in column E as your lookup value, select column B (containing all patent numbers) as the lookup array, and select the corresponding year column as the return array to fetch the application year.

3
Flag earlier patents for deletion

In column G, write an IF formula to compare the retrieved application year in column F with the current row's year. Use a formula like =IF(F2<C2, "DELETE", "") so that if the matched patent's year is earlier, it outputs 'DELETE', otherwise it remains blank.

Use Dynamic Array Formulas to Compare and Mark Patents
Handling Multiple Matches: If there is a possibility of multiple matching citations between the two columns, you may need to wrap your matching formula in TEXTJOIN to display all matches in one cell, or design the sheet to spill arrays across multiple rows.
Advanced Data Analysis in WPS Spreadsheet

Easily Handle Complex Data Comparisons in WPS Spreadsheet

WPS Spreadsheet fully supports modern dynamic array functions like XLOOKUP and TEXTSPLIT, making it highly capable of parsing comma-separated strings and automating complex multi-step data lookups seamlessly.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open your workbook containing the patent citation data.
  2. 2. Apply string splitting formulas: Click on the target cell and use the formula bar to input TEXTSPLIT alongside array-matching formulas to extract your mutual citations.
  3. 3. Lookup and flag data: Implement XLOOKUP to fetch the application years and use IF conditions in the adjacent columns to automatically mark the older rows for deletion.
Fully compatible with Microsoft Excel formulas, including dynamic arraysBuilt-in support for advanced functions like XLOOKUP and TEXTSPLITLightweight, fast, and free to use for complex daily data tasksIntuitive interface for managing complex datasets and conditional logic
microsoft office alternative - wps office

Frequently Asked Questions

What if my spreadsheet software does not support TEXTSPLIT?

If TEXTSPLIT is not available in your version, you can use the 'Text to Columns' feature under the Data tab to separate the comma-separated strings into individual cells across columns. Once separated, you can use standard MATCH, VLOOKUP, or COUNTIF functions to compare the ranges.

How can I prevent the XLOOKUP formula from returning #N/A errors?

You can utilize the built-in [if_not_found] argument within the XLOOKUP function. By adding a specific text string (like "Not Found") as the fourth argument, the formula will display a clean message instead of an error when no matching patent is located.

Can I use conditional formatting instead of marking 'DELETE' in a column?

Yes. Instead of creating a text flag in column G, you can create a new Conditional Formatting rule using the exact same logical test (comparing the year values) to automatically highlight the entire row in red if the matched patent is older.

How do I delete the flagged rows automatically?

Formulas alone cannot delete rows. After flagging rows with 'DELETE' in column G, highlight your header row, turn on Data Filtering, and filter column G to only show 'DELETE'. Select all the visible rows, right-click, choose 'Delete Row', and then clear the filter.