I have data like the following:
CategoryA SubA1 SubA2
CategoryB
CategoryC SubC1
...
I would like to avoid using scripts and hopefully only use one (albeit complex) formula to get an array like the following:
{"CategoryA", "CateogryA-SubA1", "CategoryA-SubA2", "CategoryB", "CategoryC", "CategoryC-SubC1", ...}
So far I have been able to get various pieces of this, but I don't know how to combine it all together. For example I can get {"CategoryA-SubA1", "CategoryA-SubA2"}
with ARRAYFORMULA(CONCAT(CONCAT(A1, "-"), FILTER(B1:1, NOT(B1:1 = ""))))
. I have also gotten this:
CategoryA-
CategoryB-
CategoryC-
using ARRAYFORMULA(CONCAT(FILTER(A1:A, NOT(A1:A="")), "-"))
.
The difficulty seems to come from dealing with a 2D array. I want to do a particular operation to each row, which involves doing a particular operation to each column in that row.