How to Easily Match Multiple Values in a Column in Google Sheets

Have you ever struggled with matching multiple values in a column in Google Sheets? Well, worry no more! In this article, I will share with you some handy formulas that will make this task a breeze. So, grab your favorite drink, sit back, and let’s dive in!

Matching Made Simple: Case-Insensitive Formula

Matching multiple values in a column can be done effortlessly using a case-insensitive formula. Here’s how it works:

  1. Specify the search values, such as “Battery Box,” “Battery Plate,” and “Battery Cap,” in cells C2:C.
  2. The spare parts list resides in column A2:A.
  3. We will use the LET function to name C2:C as the criteria and A2:A as the range. This makes the formula much easier to read.

Take a look at Formula #1 below:

=ArrayFormula( let( range, A2:A, criteria, C2:C, if( count(match(criteria,range,0))=counta(criteria), "In Stock","No Stock" ) ) )

Case-Insensitive Formula

In this formula, the MATCH function is used to match the criteria against the range, returning the relative position of matches and #N/A for mismatches. The IF function then tests the MATCH result, returning “In Stock” if all parts are available or “No Stock” if any part is missing.

And guess what? You can even specify the part names to lookup directly inside the formula using the VSTACK function!

vstack("Battery Box","Battery Plate","Battery Cap")

Case-Sensitive Matching: The Perfect Formula

If you need to differentiate between lowercase and uppercase letters when matching multiple values, a case-sensitive formula is what you need. Follow these steps:

  1. Use Formula #2, which is perfect for case-sensitive matching of multiple values in a column.
=ArrayFormula( let( range,unique(A2:A),criteria,unique(C2:C), if( sum(-regexmatch(range,"^"&textjoin("$|^",true,criteria)&"$"))=counta(criteria), "In Stock","No Stock" ) ) )

For example, let’s say you have two different items: “AQ101A” and “AQ101a.” Formula #1 would treat them as the same item, but Formula #2 would consider them as two distinct items.

Unleashing the Power of Partial Matching

Now, what if you need to perform partial matching of multiple values in a column? This is where things get even more interesting! Let’s explore the formulas for both case-sensitive and case-insensitive partial matching.

Case-Insensitive Partial Matching: Formula #3

To perform a case-insensitive partial match, use the following formula:

=ArrayFormula( let( range, A2:A, criteria, C2:C, if( countif(byrow(tocol(criteria,1),lambda(r,count(search(r,range)))),">0")=counta(criteria), "In Stock","No Stock" ) ) )

Case-Sensitive Partial Matching: Formula #4

For a case-sensitive partial match, try this formula:

=ArrayFormula( let( range, A2:A, criteria, C2:C, if( countif(byrow(tocol(criteria,1),lambda(r,count(find(r,range)))),">0")=counta(criteria), "In Stock","No Stock" ) ) )

Please note that these formulas use the SEARCH and FIND functions to perform the partial matching. The BYROW Lambda function helps repeat the search for each value, allowing you to aggregate the results.

That’s it! You are now equipped with the knowledge to easily match multiple values in a column in Google Sheets. So go ahead, put these formulas to use, and enjoy the magic they bring to your data analysis journey!

For more exciting tips, tricks, and insights, visit Crawlan.com and unlock the full potential of Google Sheets.

Happy matching!

Related posts