How to Filter and Delete Excel Rows by Account ID and Sales Organization
Question details
The user needs to delete rows in an Excel table that belong to a specific Account ID associated with a certain Sales Organization, while keeping other accounts intact.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Cleaning up a sales database by conditionally removing specific account records based on their associated organization codes.
- Observed behavior
- The user needs a method to systematically identify and delete rows that meet a dual-condition (Account ID tied to 'LE801BR') without having to manually search and delete them.
Ensure your dataset is formatted as an official Excel Table (press Ctrl+T) so that structured column references work correctly, and double-check that your column headers match the exact names used in the formula.
Use a COUNTIFS Helper Column to Filter and Delete
By creating a helper column with a COUNTIFS formula, you can accurately flag all rows that meet your specific conditions, making it easy to filter and delete them in bulk.
This method uses logical functions to scan the entire table. The formula checks if the Account ID in the current row exists anywhere in the table alongside the target Sales Organization. If it does, it returns TRUE, flagging the row for deletion.
Insert a new column next to your Excel table and give it a header name, such as 'Delete Flag'.
In the first cell of your new column, enter the formula: =COUNTIFS([Account ID],[@[Account ID]],[Sales Organization],"LE801BR")>0 and press Enter. The table should automatically fill the formula down.
Click the filter drop-down arrow on the 'Delete Flag' column header. Uncheck 'FALSE' so that only 'TRUE' is selected, then click OK.
Highlight all the visible filtered rows. Right-click the row numbers on the left side of the screen and select 'Delete Row' to remove them.
Click the filter icon on your helper column again and select 'Clear Filter' to reveal your cleaned dataset. You can now delete the helper column.

Efficiently Filter and Delete Rows with WPS Spreadsheet
WPS Spreadsheet fully supports advanced logical formulas like COUNTIFS, table formatting, and bulk data filtering, making data cleanup tasks quick and error-free.
- 1. Open Your File: Launch WPS Spreadsheet and open your sales data workbook.
- 2. Insert Helper Column: Add a new column and type the COUNTIFS formula to identify the specific Account ID and Sales Organization matches.
- 3. Apply AutoFilter: Navigate to the 'Data' tab and click on the 'AutoFilter' button to enable drop-down menus on your headers.
- 4. Filter by TRUE: Use the drop-down on the helper column to display only the rows marked as TRUE.
- 5. Delete Target Rows: Select the visible rows, right-click, and choose 'Delete' to instantly clean your dataset.

Frequently Asked Questions
Why is my COUNTIFS formula returning an error like #NAME?
A #NAME error usually occurs if your data is not formatted as an Excel Table, meaning the structured references (e.g., [Account ID]) cannot be recognized. To fix this, select your data range and press Ctrl+T to convert it into a Table, ensuring the column names exactly match your formula.
Will deleting filtered rows accidentally delete hidden rows?
No. When you apply a filter and select the visible rows to delete, Excel and WPS Spreadsheet are designed to only delete the rows currently visible on your screen. The hidden rows that did not meet your criteria will remain completely untouched.
Can I filter and delete rows based on multiple Sales Organizations at once?
Yes. If you need to check for multiple organizations, you can add them together in your formula using a plus sign between two COUNTIFS functions, or use an array constant if you are familiar with array formulas, to flag rows matching any of the specified organizations.




