I have a big list of songs in Google Sheets which looks a little bit like this:
| Number of Song | Beginning of Song | Title of Song | Alternate Title of Song |
|---|---|---|---|
| A1 | Should old Acquaintance | Auld Lang Syne | |
| A2 | Old MacDonald had a farm | ||
| A3 | Hark when the night | Scotland the Brave | |
| B54 | Should old Acquaintance |
What I want to do is to do an alphabetically ordered index of this with the following columns:
| Beginning or Title of Song | Number of Song |
|---|---|
| Auld Lang Syne | A1 |
| Hark when the night | A3 |
| ... | ... |
| Should old Acquaintance | A1, B54 |
So what I did was this function for the first column:
=query(flatten(Songs!B2:D1004); "where Col1 is not null order by Col1 asc")
And for the second column a not so elegant:
=iferror(iferror(index(songs!A:A;compare(A4; songs!B:B;0));iferror(index(songs!A:A;compare(A4; songs!C:C;0));index(songs!A:A;compare(A4; songs!D:D;0)))))
What I am wondering:
- Is there a better way for column 2?
- How can I implement the fact that there could be two numbers for one song?
I would be very happy to know an answer!









