Formula to ignore blanks

New Contributor

Hi There,

 

I am trying to do a formula of =A1=B1 but to ignore blank cells how do I do this? 

 

Code 1Code 2Match?
833834 
833833 
   
833837 

 

So I would like the formula in column C. I would like it to come back with "Yes" if the two columns match and "No" if they do not match. But my normal formula of =A1=B2 is counting the blank row as "Yes" because technically they are the same. How do I get it to ignore these? 

2 Replies

@PrettyDreamer 

=IF(AND(A2=B2,A2<>"",B2<>""),"Yes","No")

 

I would enter above formula in cell C2 and copy down.

You are my saviour - thank you!