I have a Movie list using Google Sheets that I would like do some sorting with using a script rather than a formula.
Column A is the movie Title. I would like to be able to sort the movie titles alphabetically but ignore when a movie title BEGINS with "A", "An" and "The". For example: "The Abyss" would be filed under 'A' for "Abyss" but would still display as "The Abyss".
I would also like it to ignore a few other words that I can continue to enter as needed. For example: "Marvel's"... So that "Marvel's Iron Man" would be filed under 'I' for "Iron Man" but would still display as "Marvel's Iron Man".
I know how to do it with this formula in a new column:
=IF(LEFT(A2,2)="A ",RIGHT(A2,LEN(A2)-2), IF(LEFT(A2,3)= "An ",RIGHT(A2,LEN(A2)-3), IF(LEFT(A2,4)="The ",RIGHT(A2, LEN(A2)-4),A2) ) )
But I would rather do it through a script so that I don't need to use another column for this. When someone clicks to sort movie titles A-Z, it would be nice if it ignored "A", "An", and "The" without having to use an additional column of titles. It's less messy and takes up less space.
Also, if there is a way through the script for it to first sort by Movie Title and then by release Date by default, that would be great. But of course, it would still be nice not if it weren't locked into that sorting order so that friends and family can sort as they like (by year, etc.) when browsing our catalog. This is not as important of a feature, though.