How to reference a cell with specifying some offset row where it should be shown

31 views Asked by At

I have the following data...

enter image description here

...and I need to show it in the following format

enter image description here

Each cell in the second table is (obviously) taken from the first one, mostly using vlookup. My question is, how can I make each data to conditionally "skip" some rows. For example, Category "B" would need to skip 9 rows, because Category "A" used them all for 2 sub-categories and 7 stuffs that it has. Or Sub-Category "2" needs to skip 3 rows, etc.

How can I achieve this? Is it possible using formula, or is there any other approach to this? Thanks in advance for your help.

1

There are 1 answers

2
rockinfreakshow On BEST ANSWER

You may try:

=reduce(tocol(,1),unique(tocol(B2:B,1)),lambda(a,c,ifna(vstack(a,c,
        reduce(tocol(,1),unique(filter(C:C,B:B=c)),lambda(f,q,vstack(f,hstack(,q),hstack(,,filter(A:A,B:B=c,C:C=q)))))))))

enter image description here