Sajan
Excel Ninja
Hi @abhi2611:
Absolutely... however, I had to change the approach slightly.
In my setup, I had the label "Headings" in cell L8, and the label "List" in cell M8.
Put the following formula in cell L9:
=IFERROR(IF(COUNTIF(L$8:L8, L8)<COUNTA(INDEX(List, 0, MATCH(L8,Headings,0))), L8,NA()), INDEX(Headings, MATCH(1, ISNA(MATCH(Headings, L$8:L8,0))*(TRANSPOSE(MMULT(TRANSPOSE(N(List<>"")), ROW(List)^0)>0)),0)))
enter with Ctrl + Shift + Enter, instead of Enter
Copy down to additional rows until you get an error value.
Put the following formula in cell M9:
=INDEX(List, SMALL(IF(INDEX(List, 0, MATCH(L9, Headings,FALSE))<>"", ROW(INDEX(List, 0, MATCH(L9, Headings,FALSE)))-MIN(ROW(List))+1), COUNTIF(L$8:L8, L9)+1), MATCH(L9, Headings,FALSE))
enter with Ctrl + Shift + Enter, instead of Enter
Copy down to additional rows
I got the following output for your sample data:
[pre]
[/pre]
I did some tests but please make sure you test these formulas further.
I am certain that the formulas can be optimized. I will look at optimizing them once you confirm that they are working for you.
Cheers,
Sajan.
Absolutely... however, I had to change the approach slightly.
In my setup, I had the label "Headings" in cell L8, and the label "List" in cell M8.
Put the following formula in cell L9:
=IFERROR(IF(COUNTIF(L$8:L8, L8)<COUNTA(INDEX(List, 0, MATCH(L8,Headings,0))), L8,NA()), INDEX(Headings, MATCH(1, ISNA(MATCH(Headings, L$8:L8,0))*(TRANSPOSE(MMULT(TRANSPOSE(N(List<>"")), ROW(List)^0)>0)),0)))
enter with Ctrl + Shift + Enter, instead of Enter
Copy down to additional rows until you get an error value.
Put the following formula in cell M9:
=INDEX(List, SMALL(IF(INDEX(List, 0, MATCH(L9, Headings,FALSE))<>"", ROW(INDEX(List, 0, MATCH(L9, Headings,FALSE)))-MIN(ROW(List))+1), COUNTIF(L$8:L8, L9)+1), MATCH(L9, Headings,FALSE))
enter with Ctrl + Shift + Enter, instead of Enter
Copy down to additional rows
I got the following output for your sample data:
[pre]
Code:
Headings List
Jan A
Jan I
Feb B
Feb F
Feb J
Mar C
Mar K
Apr D
May E
May H
May M
I did some tests but please make sure you test these formulas further.
I am certain that the formulas can be optimized. I will look at optimizing them once you confirm that they are working for you.
Cheers,
Sajan.