How to Delete Multiple Columns in Excel with a Condition – 3 Methods

This is the sample dataset.

how to delete multiple columns in excel with condition

To delete multiple columns based on a condition (for example, with a negative Rh factor):


Method 1 – Use the Find & Replace Tool to Delete Multiple Columns with a Condition

Steps:

  • Select the row with the condition. Here, Rh Factor.

Use of Find & Replace Tool to Delete Multiple Columns with Condition

  • Press Ctrl+F to open up the Find and Replace dialog box.

  • In Find what, enter Negative and click Find All.

You will see the list of cells that contain this word.

  • Press Ctrl+A to select those cells and close the window.

Use of Find & Replace Tool to Delete Multiple Columns with Condition

  • All cells that meet the condition are selected and highlighted.
  • Hold Ctrl and press the to open the Delete dialog box.

  • Select the Entire column and click OK to delete the columns that contain those cells.

Read More: How to Delete Every Other Column in Excel


Method 2 – Deleting Multiple Columns with Blank Cells

Deletion of Multiple Columns in Excel with Blank Cells

 

Steps:

  • Select the dataset and click F5 to open the Go to dialog box.
  • Click Special.

Deletion of Multiple Columns in Excel with Blank Cells

  • In the Go to Special window, select Blanks and click OK.

Blank cells are highlighted.

Deletion of Multiple Columns in Excel with Blank Cells

  • Press Ctrl and  to open the Delete dialog box.
  • Select Entire column to see the final result.


Method 3 – Utilize the Sort & Filter Feature to Delete Multiple Columns Based on a Condition

Steps:

  • Insert a helper row to store the serial number of the cells.

  • Select the dataset (exclude the headers).

Utilize Sort & Filter Feature to Delete Multiple Columns in Excel Based on Condition

  • Go to the Data tab and select Sort in Sort & Filter.

  • In the Sort window, click Options.

Utilize Sort & Filter Feature to Delete Multiple Columns in Excel Based on Condition

  • Choose Sort left to right and click OK.

Utilize Sort & Filter Feature to Delete Multiple Columns in Excel Based on Condition

  • In Sort by, select the row number based on which data will be sorted. Here, row 7 (the Rh factor).
  • Click OK.

Utilize Sort & Filter Feature to Delete Multiple Columns in Excel Based on Condition

  • The negative Rh factor cells are sorted. Select those cells and delete the Entire column as described in the previous methods.

Utilize Sort & Filter Feature to Delete Multiple Columns in Excel Based on Condition

This is the output.

Utilize Sort & Filter Feature to Delete Multiple Columns in Excel Based on Condition

 


How to Delete Rows Based on Conditions

This is the dataset:

How to Delete Rows Based on Conditions

The employees are divided in 3 groups (A, B & C). To delete the rows that contain group C, use the Filter option:

Steps:

  • Select the entire dataset and select Filter in the Data tab.

How to Delete Rows Based on Conditions

  • The header column displays a filter icon.
  • Click the filter icon in Group and select Sort A to Z.
  • Click OK.

  • The list is sorted: rows containing group C are at the bottom.

How to Delete Rows Based on Conditions

  • Select those three cells and press Ctrl and to open the Delete dialog box.

How to Delete Rows Based on Conditions

  • Select the Entire row and click OK. The 3 rows will be deleted.

How to Delete Rows Based on Conditions

 


Download Practice Workbook


 

Related Articles


<< Go Back to Delete Columns | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Aniruddah Alam
Aniruddah Alam

Md. Aniruddah Alam, a graduate of Bangladesh University of Engineering & Technology, Dhaka, holds a BSc.Engg in Naval Architecture & Marine Engineering. Joining Softeko in August 2022 as an Excel and VBA content developer, he has authored 90+ articles, covering fundamental to advanced Excel topics. He actively develops VBA codes for Excel automation and offers solutions in the Exceldemy Forum. Beyond work, he finds leisure in reading books, and taking relaxing walks, showcasing well-rounded blend of professional and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo