How to sort a list excluding the, an, a

Nancy Read 0 Reputation points
2026-08-30T21:37:32.2966667+00:00

I have a list of books that I would like to alphabetize by title but I want to exclude the first word if it is the, a, or an.

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments

3 answers

Sort by: Most helpful
  1. Ashish Mathur 102.6K Reputation points Volunteer Moderator
    2026-08-30T23:04:07.44+00:00

    Hi,

    In cell B2, enter this formula

    =LET(r,A2:A5,SORTBY(r,REGEXREPLACE(r,"^(A|An|The)\s+","",1,1),1))

    Hope this helps.

    User's image

    Was this answer helpful?

    0 comments No comments

  2. EmilyS726 271.4K Reputation points Independent Advisor
    2026-08-30T22:25:20.6166667+00:00

    Hello,

    I am afraid you would need to have a helper column first.

    This is what I use for the result below in the B column. Then you just need to sort the B column.

    =LET(t,A2,w,TEXTBEFORE(t&" "," "),IF(ISNUMBER(XMATCH(LOWER(w),{"the","a","an"})),IFERROR(TEXTAFTER(t," "),t),t))
    

    User's image

    Was this answer helpful?

    0 comments No comments

  3. chandler peeler 0 Reputation points
    2026-08-30T21:40:04.33+00:00

    You can do this with a helper column that strips the leading article, then sort by that column instead of the title column directly.

    1. In the cell next to your first title (e.g., B2 if titles are in A2), enter this formula:

    =TRIM(IF(LEFT(A2,4)="The ",MID(A2,5,255),IF(LEFT(A2,3)="An ",MID(A2,4,255),IF(LEFT(A2,2)="A ",MID(A2,3,255),A2))))

    1. Fill it down for all your rows.
    2. Select your data, go to Data > Sort, and sort by the helper column (not the title column) A to Z. Your titles will reorder along with it.
    3. Hide or delete the helper column once you're done.

    One thing to watch for: this formula is case-sensitive and expects a single space after the article ("The ", "A ", "An "). If your titles aren't consistently capitalized, wrap each LEFT(...) comparison in LOWER() so it matches regardless of case, e.g. LOWER(LEFT(A2,4))="the ".

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.