Comparing Concatenate Cells

tpierce

New Member
Joined
Apr 16, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am having issues comparing 2 cells that I have used the Concatenate function & Mid function to combined City, State. I am using a basic IF statement to compare the 2 cells. My question is when they have the same information in both cells the function reads "NO" however if they are blank it reads "YES", suggesting it is not reading the text to compare. Any thought on how to end round this?

@CURRENT LOCATION FORMULA =IFNA(MID([@[CRNT LOC PULL]],FIND("of",[@[CRNT LOC PULL]],1)+3,50),"")
@FROM FORMULA =IFERROR(CONCATENATE([@[FROM CITY ]]," , ",[@[FROM ST]]),"")

COMPARE FORMULA =IF([@[CURRENT LOCATION]]=[@FROM],"YES","NO")
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
add an if statement around it saying, if the current location is "" then "Blank" or some other output you choose.
Excel Formula:
=if(([@[CURRENT LOCATION]]="","BLANK",IF([@[CURRENT LOCATION]]=[@FROM],"YES","NO"))
Then it wont consider blank cells in the logic
 
Upvote 0
Hi & welcome to MrExcel.
If your formula is returning "No" then the cells are not exactly the same. Maybe a matter of leading/trailing spaces.
 
Upvote 0
Hi & welcome to MrExcel.
If your formula is returning "No" then the cells are not exactly the same. Maybe a matter of leading/trailing spaces.
Thank you, you were correct, I had an extra space that I failed to catch.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top