'google sheet : How to find the length of array?

I try to query from other sheet using vlookup() or something similar. I want to count how many array it will produce.

How can i find the length of the output or the resulting array from query() or filter() or vlookup()? Something similar to len() but for counting array.

Thanks



Solution 1:[1]

you can use ROWS or COLUMNS

=ROWS(QUERY(your_query))

Solution 2:[2]

It is unclear what you want because we don't know the dimensions of your array or whether you want to count blank cells that may be in the array.

If you want to know only how many rows there are including blanks, then wrap your formula in =ROWS( ).

If you want to know only how many columns there are including blanks, then wrap your formula in COLUMNS( ).

If you want to know how many cells there are in the array total including blanks, then use this pattern (where your formula is placed between each set of parentheses): =ROWS( ) * COLUMNS( ).

If you want to know how many non-null (i.e., not blank) entries there are in the array, then wrap your formula in =COUNTA( ).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 player0
Solution 2 Erik Tyler