简体   繁体   中英

How to use an AND statement with ARRAYFORMULA when searching a range in a Google Sheet

I have this function which works great.

=transpose
(
    split
    (
        ARRAYFORMULA
        (
            TEXTJOIN
            (
                ", ",TRUE,
                (
                    IF
                    (
                        A3:A100="Active",
                        B3:B100
                        ,""
                    )
                )
            )
        ),","
    )
)

It says if Anything Between A3 and A100 is the word Active, then Display B3 in a vertical list.


I am trying to query multiple parameters though and am hitting dead ends. When I try to add an AND statement to the IF query, I get no results. Example:

=transpose
(
    split
    (
        ARRAYFORMULA
        (
            TEXTJOIN
            (
                ", ",TRUE,
                (
                    IF
                    (
                        AND(A3:A100="Active", C3:C100="Sold"),
                        B3:B100
                        ,""
                    )
                )
            )
        ),","
    )
)

not supported. use multiplication:

=TRANSPOSE(SPLIT(ARRAYFORMULA(TEXTJOIN(", ", 1, 
 IF((A3:A100="Active")*(C3:C100="Sold"), B3:B100, ))), ","))

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