Pay attention when you concatenate – A1 & B1 vs. A1 & “|” & B1

In many case, we may want to combine texts from different cells.  This can be done by either CONCATENATE function or simply an Ampersand &.  E.g. A1 & B1 & C1 …… We may take it for granted as it looks so straight forward… Well.  It actually depends on the reason for combining texts from different cells.  If you are doing so because you want to Perform VLOOKUP with 2 lookup values, the robust way to combine texts should include a delimiter in between, e.g. A1 & “|” & B1 …   Why?  Because laziness has a price. Think about a situation that you have “Apples Hop” and “Apple Shop” in your data as shown below:Excel Tips - Concatenate lookup values without delimiter

You would expect “Apples Hop” be different from “Apple Shop”.  Right?  However, when you combine the words together, they become indifferent because VLOOKUP is not case-sensitive.  “ApplesHop” and “AppleShop” are basically the same to VLOOKUP as “appleshop”. To play safe, make sure you have included a delimiter in between,  see below:Excel Tips - Concatenate lookup values without delimiter 1unless you understand your data inside-out and you are 100% confident such coincidence would not happen.  Aren’t you?

Sometimes, winning a lottery is easier than making an Excel formula error-free.  🙂

This entry was posted in Excel Tips, Formula and tagged , . Bookmark the permalink.

Comments, suggestions, corrections are welcome.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s