1

I have the following formula...

=ARRAYFORMULA( VLOOKUP( QUERY(results_sheet_1:range, query_string_1), lookups_sheet:range, 11, FALSE))

... which returns a single column of values.

I need to call this formula on multiple sheets (results_sheet_1, _2, _3 etc) and combine the output in a single column. The query string is different for each sheet, though in all cases only a single column is returned.

How can this be done?

1
  • share a copy/sample of your sheet with example of desired result Commented May 24, 2021 at 10:39

2 Answers 2

2

Replace this:

...QUERY(results_sheet_1:range, query_string_1)...

with this:

{QUERY(results_sheet_1:range, query_string_1);QUERY(results_sheet_2:range, query_string_2);QUERY(results_sheet_3:range, query_string_3)}

Being sure to include the curly braces and semicolons between the ranges.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. I have updated the question to mention the query string is different for each sheet.
@x-x I have updated my answer accordingly.
0

If you don't know upfront how many queries you will have, use the trick from this video, it allows to overcome obstacles of using array returning formulas within arrayformula by changing it to "reduce" formula.

Video: https://www.youtube.com/watch?v=QtIM0-bAVDg

Trick:

   reduce (
      "",
      filter(A1:A&"|"&B1:B),
      lambda(
        accumulator,
        current,
        vstack(
          NOT_ARRAYFORMULA_FRIENDLY_FUNCTION(
            SPLIT_IF_THERE_ARE_MULTIPLE_ARGUMENTS(current)
          ),
          accumulator
        )
      )
    )

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.