Home > front end >  Google Sheets - Stacking Arrays when they are not empty
Google Sheets - Stacking Arrays when they are not empty

Time:08-03

I have in Google Sheets 4 (possible) arrays that I want to stack one over the other including the title of each array.

Stacking them depends on the content of the array: If one of the arrays has 0 values then that specific array is to be excluded from the stack.

I tried using "IF", saying that if the array has no products (0) to show nothing (""), but it gives me an error. Another way is to introduce an empty array of one row I think, but then is making extra rows not needed.

So far I made it to stack them with this:

={indirect("B5:D"&D3 6);indirect("F4:H"&H3 6);indirect("J4:L"&L3 6);indirect("N4:P"&P3 6)}

(I used Indirect the count of products to extract the part of the array that is populated and not including all the blank cells)

enter image description here

  • Related