Sharing some useful tips, solutions and notes for Geeks.

Monday, May 11, 2020

Match two columns in excel sheet using COUNTIF function

Sometimes we need to match two columns to see if a term in Column A is there in Column B. In such cases COUNTIF function will be handy.

Today i needed two columns to match and find the existing one. So for the same i used this and achieved the result. I will tell you how.

So here i needed SKU column matched with BARCODE column to identify what all SKUs are matching with BARCODE.
So for this, we can write COUNTIF as

                  =IF(COUNTIF($C$1:$C$8,B1)>0,"Match found","Not found")

Here B1 indicates the first cell of Source SKU and $C$1 to $C$8 indicates to check from first cell to 8th cell of the C column(BARCODE). So in short, B1 cell value will be checked from 1 to 8th cell of C column and if matched "Match found" text will written in next Coumn.

So once we run this throughout the column we will get the matched ones like below.

So you can see we got the matched ones. This formula can be used to match Columns of any length, just need to update the $C values to cover those.

Fairly easy and quick solution - right? 

No comments: