Reputation: 5
I'm trying to keep the code to just one cell. I want to remove all the spaces and then compare the left 5 characters to another cell.
I have this
=LEFT(A1,5)=LEFT(B1,5)
And I have this
=SUBSTITUTE(A1," ", "")
I want to combine the two but can't get it right.
=SUBSTITUTE(A1," ","")*LEFT(A1,5)=SUBSTITUTE(B1," ","")LEFT(B1,5)
Upvotes: 0
Views: 1525
Reputation: 807
Try using the return value of the SUBSTITUTE
function as the input for the LEFT
function.
=LEFT(SUBSTITUTE(A1," ", ""),5)=LEFT(SUBSTITUTE(B1," ",""),5)
What this does is that it removes the spaces from the value of the cell before it puts it through the LEFT
function.
Upvotes: 1
Reputation: 1338
you mean it like this?
=LEFT(SUBSTITUTE(A1," ",""),5)=LEFT(SUBSTITUTE(B1," ",""),5)
Upvotes: 0