Function Problems

Filter Excel Rows Where One Column Is Greater Than Another

Khadija KhanKhadija Khan Nov 18, 2026 868 views

Question details

Display rows where the number in column M is greater than the number in column N on the same row.

Filter Excel Rows Where One Column Is Greater Than Another
Product
Microsoft Excel
Device & OS
not provided
Scenario
Compare values in two columns and show only rows that meet the greater-than condition.
Observed behavior
The desired result is a list of rows where each column M value is greater than its corresponding column N value.
Before you start

Check that columns M and N contain numeric values and identify your header and data rows. The examples below assume headers are in row 1 and data starts in row 2.

Solution 1Recommended

Use a helper column to filter the original Excel rows

Use this method to filter the existing worksheet without creating a separate results list.

1
Add a helper header

Enter a header such as Match in cell O1, or choose another empty column next to your data.

2
Enter the comparison formula

In cell O2, enter =IF(M2>N2,"FILTER","") and press Enter.

3
Copy the formula down

Drag the fill handle from O2 down through the last data row so each row compares its own M and N values.

4
Filter the matches

Select the data range including column O, then choose Data > Filter. Open the filter arrow in O1 and select only FILTER.

Use a helper column to filter the original Excel rows
Hide the helper column: After applying the filter, you can right-click the O column heading and choose Hide. The filter remains applied.
Compare spreadsheet columns

Filter rows by comparing columns in WPS Spreadsheets

Use a helper formula and the Filter command in WPS Spreadsheets to show rows where column M is greater than column N.

  1. 1. Open the spreadsheet: Open your workbook in WPS Spreadsheets and confirm that the data starts in row 2.
  2. 2. Add a helper column: Enter Match in O1, then enter =IF(M2>N2,"FILTER","") in O2.
  3. 3. Fill the formula: Drag the fill handle from O2 down to the last row of your data.
  4. 4. Apply the filter: Select the data range including column O, choose Data > Filter, and use the O1 filter arrow to select FILTER.
Compare values row by row with a helper formula.Filter the original worksheet without moving its data.Open and edit Microsoft Excel XLSX files.Use a familiar spreadsheet interface for free.
QA img-9

Frequently Asked Questions

Can I use a helper column other than O?

Yes. Enter the helper header and formula in any empty column, copy the formula down, and include that column in the range selected for Data > Filter.

How do I include rows where the two values are equal?

Use >= instead of >. For example, enter =IF(M2>=N2,"FILTER","") in the helper column and filter for FILTER.

Why does the FILTER formula show a spill error?

The output range may contain existing data. Clear the cells below and to the right of the formula, or move the formula to a larger empty area.

Does the helper-column filter update when values change?

The helper formulas recalculate when their inputs change, but you may need to reapply the filter using Data > Reapply to update which rows are visible.