HomeGoogle DocsSpreadsheetVertical Lookup in a Column for a Word in Google Sheets

Vertical Lookup in a Column for a Word in Google Sheets [Word in a Sentence]

Published on

You can Lookup in a column for a word in a sentence in Google Sheets and return corresponding values. The text can be comma separated in a cell, in the beginning, middle or end of a sentence etc. When I say this, instantly the name of one function may flash in your mind. It’s Vloolup or Index functions, right? But it’s very complicated to do such a vertical lookup in a column for a word in Google Sheets. Then what is the best option?

No doubt, we can depend on Google Sheets the versatile Query function. I am sure that you can quickly learn this. I believe the below example is enough for you to learn this awesome trick to lookup a text in Sentence similar to Vertical Lookup.

How to Vertical Lookup in a Column for a Word in Google Sheets [Not Single Word, But Word Within Sentence]

In the below dummy data, I want to lookup column A for a word or name “Kent kelly” and returns related values from the same row. As you can see, the lookup search key “Kent kelly” is in Cell A3, but with another name separated by a comma.

vertical lookup for a text in a sentence

See the versatility of the Query formula. Instead of Vlookup, it takes the role of Vertical lookup.

The above Query formula lookup Column A for the text “Kent kelly” and returns the corresponding values from Column B and C, similar to Vlookup. How?

I’ve used Query String Comparison Operator called Contains in this example.

How to Use “Contains” String Comparison Operator in Google Sheets Query

Here is the formula which I’ve used in the above example.

=query(A2:C5,"select B,C where A contains 'Kent' ")

Here in this formula, A2: C5 is the data range. The formula returns the values from Column B and Column C if Column A contains the word “Kent”.

If there are multiple matches it would return those rows too. But you can limit that with the Limit clause in Query. Here are that tips.

Similar: Three Different Ways to Limit Number of Rows in Google Sheets Query

From the formula itself, you can understand how to use Contains String Comparison operator in Google Sheets Query. But you should know the following points before using this formula.

1. Query function is case sensitive.

2. If the name is “Kent Kelly” the formula treats this as a different text. So you should use the full name “Kent Kelly” in the formula. When you use “Kent” only in the formula, it can find matching words in the column like “Kent kelly” also. If you want to overcome this case sensitivity, you may want to use Upper or Lower functions within Query.

In concise, for Vertical Lookup in Google Sheets, Vlookup is not the only solution. You can use Query or Index Match also.

You May Also Like: Index Match – Better Alternative to Vlookup and Hlookup in Google Sheets

But for this particular example, i.e., Vertical Lookup in a Column for a Word in Google Sheets, Query is the one and only solution. Below is a detailed tutorial on the Contain operator.

Detailed Reading: CONTAINS Substring Match in Google Sheets Query for Partial Match

We are ready with some inspirational new year picture quotes.

Wish you a very happy and prosperous new year 2018. Get Inspired.

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

XLOOKUP in Excel: Working with Visible Rows in a Table

In Excel, the XLOOKUP function isn't inherently designed to exclusively work with visible rows;...

SUMPRODUCT Differences: Excel vs. Google Sheets

The core purpose of the SUMPRODUCT function remains consistent across both Excel and Google...

Sum Values by Month and Category in Excel

With the help of EOMONTH, UNIQUE, and SUMIFS functions in Excel, you can efficiently...

More like this

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

Analyzing Column A Between Non-Adjacent Values in Column B: Google Sheets

This tutorial addresses a common scenario encountered in Google Sheets: how to sum, average,...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.