Hello,
Keeping with the same approach as before, try the following formulas to get the letters and date headings.
For convenience, I have assumed that "List" refers to the alphabet data above, and "Headings" refers to the date headings.
To get the alphabets, use the following formula:
=INDIRECT("R" & SUBSTITUTE(TEXT(SMALL(IF(List<>"", ROW(List) + COLUMN(List)%), ROW(A1)), "#.00"), ".", "C"), FALSE)
enter with Ctrl + Shift + Enter, instead of just Enter
Copy down to additional rows until you get an error value.
Assuming that the alphabet list is starting in cell B9, put the following formula in the adjacent cell (C9):
=INDEX(Headings, MIN(IF(COUNTIF(B9, List)>0, COLUMN(List)))-MIN(COLUMN(Headings))+1)
enter with Ctrl + Shift + Enter, instead of Enter
Copy down to additional rows.
(Feel free to trap the errors using IFERROR() if desired.)
I got the following output for your sample data:
[pre]
Code:
List Headings
A Jan
B Feb
C Mar
D Apr
E May
F Feb
H May
I Jan
J Feb
K Mar
M May
[/pre]
Cheers,
Sajan.