How to Remove Duplicates Ignoring Spaces in Microsoft Excel and Google Sheets
Microsoft Excel
- Start by opening your Excel workbook which contains the data from which you want to remove duplicates.
- Suppose your data is in column A starting from cell A1. In cell B1, adjacent to A1, insert the formula
=SUBSTITUTE(A1," ","")
and pressEnter
. This formula uses Excel's SUBSTITUTE function to remove all spaces in the cell value. - Drag the fill handle (small square at the bottom-right corner of the cell) down to apply this formula to all cells in column B.
- Now, select the range in column B, navigate to the
Data
tab in the Ribbon, and in theData Tools
group, click onRemove Duplicates
, a feature Microsoft provides to easily identify and eliminate duplicate values. - Make sure to uncheck
My data has headers
box if your data doesn't have a header, and then clickOK
. This will remove all duplicate entries from your selected data.
Google Sheets
- In your Google Sheets document, if your data is in column A starting from cell A1, in the adjacent cell B1, input the formula
=SUBSTITUTE(A1," ","")
and pressEnter
. Google Sheets' SUBSTITUTE function will remove all the spaces in the cell value, just like in Excel. - Extend this formula to all cells in column B by dragging the fill handle down.
- Now, select the range in column B, click on the
Data
menu, and selectData validation
. - In the
Data validation
dialog box, under theCriteria
section, selectCustom formula is
, and input=COUNTIF($B$1:$B1, B1)=1
(assuming your data starts from cell B1). This data validation feature ensures only unique entries are considered. - Finally, click
Save
to apply these settings.
Summary This tutorial shows you how to remove duplicates ignoring spaces in Microsoft Excel and Google Sheets. It demonstrates the use of functions like SUBSTITUTE and features like 'Remove Duplicates' or 'Data Validation' to cleanse your data of unwanted duplicate entries.