When you copy and paste text into a cell, do you sometimes have spaces before or after? Do they distort your results?
To avoid having distorted results because of spaces before or after a word (or text string) in a cell, or even having false duplicates in a pivot table, use the TRIM function.
=TRIM(text)
Use this function in a formula and select the cell containing the text to “clean“.