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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
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,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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