The contents sometimes contain extra spaces which you need to remove. You can use the Trim function in Excel and in Google Sheets, but that will generate a new column. If you just want to remove the extra spaces, you can use the "trim whitespace" command.
Step 1: Select the data range with extra spaces;
Step 2: Click the "Data" tab from the ribbon;
Step 3: Click "Trim whitespace" from the drop-down list;
Step 4: A quick summary message will display;
Step 5: The data range after removing extra spaces will display.