简体   繁体   中英

Return an array based on Criteria in Google Sheets

first time posting and looking for some help (please be nice:D)!

I am looking for an array formula to return an array, if the values in a range contain certain text.

For example, in the table below, I have a Lookup range in the left column. I wish to return the values containing "Country", and the end result would be an array with the relevant values, as per the right column. Furthermore, I only want to return the values containing "Country", and not have any blank spaces within the resulting array.

I found this thread: Excel how to return an array that meets a certain condition? and tried replicating it in G-sheets, but couldn't produce the result I was looking for. This might be because the formulas in Excel and G-sheets may be written/interpreted differently, and I'm no expert on that.

Finally, I am keen to work out the solution in Google Sheets, as I wish to work collaboratively with my team as the sole (barely much of a) "tech guy" in the team.

Any help will be appreciated!

Lookup Range End Result
CountrySouth Korea CountrySouth Korea
CountryJapan CountryJapan
CausesHealth
CausesAgriculture
SupportResume
SupportInterviews
SupportCoaching

Image of the Data

Any help is greatly appreciated!

use:

=FILTER(A:A; REGEXMATCH(A:A; "Country"))

keep in mind that regex is case-sensitive

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM