Do My First n Characters Of Each Row Match In Both Columns?.


Hello Excellers and welcome back to another #FormulaFriday #Excel tip in my 2019 series. So, today let’s tackle an Excel question asked by a subscriber to my Monthly Newsletter. They needed to check if the first 5 characters of their data in Column A matched the first 5 characters if their data in Column B. They had two lists of serial numbers where only the first 5 characters were required to match. A sample of the Excel data set can be seen below.

Match first 5 characters of two columns of data

The LEFT Function.

So, we can use the LEFT Function to solve this question. The LEFT function extracts a given number of characters from the left side of a supplied string. First, let’s look at the syntax of the function.

Syntax =LEFT (text, [num_chars]) where

  • text – This is the text from which to extract characters.
  • num_chars – [optional] This is an optional argument. It is the number of characters to extract, starting on the left side of the text. The default is 1 if this is left blank.

In this example, we test the first 5 characters in Column A vs Column B. The formula is as below

=LEFT(A2,5)=LEFT(B2,5)

Subsequently, using the comparison of = will return a TRUE or FALSE result whether the cells match, and in this case using LEFT if the first 5 characters match.

Finally, do you have you an Excel question?. So, why not leave it in the comments below.

Also, do you want more Excel and VBA tips? Sign up for my Monthly Newsletter where I share 3 Tips on the first Wednesday of the month. You will receive my free Ebook with 30 Tips. Don’t forget to check out all of my Formula Friday Blog posts below.

How To Excel At Excel – Formula Friday Blog Posts.

More Excel Tips_New1
Learn Excel With Our Excel Online Courses

 

master_728x90

 

 

Do You Need Help With An Excel Problem?.

Finally, I am pleased to announce I have teamed up with Excel Rescue,  where you can get help with Excel FAST. Why not check it out?.

ExcelRescue.net

Barbara

Barbara is an experienced data analyst with over 20 years of experience. Author of the How To Excel At Excel Top 50 Excel tips Ebook, YouTuber and Excel Blogger.

Recent Posts