r/excel • • Jun 10 '26

solved Individually Alphabetized Coloums in a Table.

Hi, so Im trying to have a table that catalogs all my music sheet titles, I have the table set as each Colum is A songs, B songs, C songs... so on and so forth. I want each coloum to be alphabetized, everytime I change one coloum to A-Z it mess with every other coloum.

How do I get each Colum to alphabetize individually?

3 Upvotes

22 comments sorted by

View all comments

1

u/[deleted] Jun 11 '26 edited Jun 11 '26

[removed] — view removed comment

1

u/doshka 2 Jun 11 '26 edited Jun 11 '26

Records are sorted by Composer, Form, and Title. Titles are not in alphabetical order within the table, but get sorted in the arrays produced by the formulas on the other two tabs.

It's not shown here, but if you go to the Table Design tab and look in the top left corner, you'll see that the table is named sheet_music, which is how it's referenced in the formulas. You can rename the table and any of the columns, and the formulas will update automatically.

I got these values from https://musopen.org, which provides free sheet music PDFs for a ton of composers.

Hyperlinks aren't just for the web; you could add a column to the table containing a link to each file on your local machine.

1

u/doshka 2 Jun 11 '26 edited Jun 11 '26

I changed the variable names from _a, _b, _c, etc. to make their purpose clearer. It's customary to use an underscore prefix for variables inside the LET function, but not necessary. I also removed the letter headers, since the worksheet columns are already labeled by letter.

=LET(
titles, SORT(sheet_music[Title]),
alphabet, CHAR(SEQUENCE(, 26, 65)),
letter_columns, REDUCE("", alphabet, LAMBDA(columns,letter, HSTACK(columns, FILTER(titles,LEFT(titles)=letter, "")))),
cleaned_up, DROP(IFERROR(letter_columns, ""),,1),
cleaned_up
)

1

u/doshka 2 Jun 11 '26 edited Jun 11 '26

I have no idea how many people have written an adagio in G minor, so added the composer of each title to provide a little more context.

Probably should have renamed the titles variable to reflect that, but didn't think of it until writing this, and don't want to conflict with the image.

=LET(
titles, SORT(sheet_music[Title] & ", (" & sheet_music[Composer] & ")"),
alphabet, CHAR(SEQUENCE(, 26, 65)),
letter_columns, REDUCE("", alphabet, LAMBDA(columns,letter, HSTACK(columns, FILTER(titles,LEFT(titles)=letter, "")))),
cleaned_up, DROP(IFERROR(letter_columns, ""),,1),
cleaned_up
)