I have 2 columns in Sheet 1 (named Projects), "Projects" in column A and "Status" in column B. The number of rows is dynamic.
In Sheet 2, I want to extract the projects that meet a certain string criteria and populate a table. For example, if the Status is "Operating", take the project name in column A for that row and put it in a table.
I tried =IF(Projects!B1:B="Operating",Projects!A1:A,"") but it returns the names of the projects in the same row position as in Sheet 1. So if there is a 2 row gap in Sheet 1 between two operating projects, it keeps the 2 row gap in Sheet 2.
How do I get rid of the gaps?
There are some ways to accomplish this.
Your code: =IF(Projects!B1:B="Operating",Projects!A1:A,"")
After some tweaks (working):
=FILTER(
ArrayFormula(IF(Projects!B1:B="Operating",Projects!A1:A,"")),
ArrayFormula(IF(Projects!B1:B="Operating",Projects!A1:A,""))<>""
)
As a bonus - you need this code only in one cell
Picture:
You need only this:
=QUERY(Projects!A1:B,"select A where B='Operating'")
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.