Custom ORDER BY to ignore 'the'

后端 未结 7 2121
野趣味
野趣味 2020-12-09 11:00

I\'m trying to sort a list of titles, but currently there\'s a giant block of titles which start with \'The \'. I\'d like the \'The \' to be ignored, and the sort to work o

7条回答
  •  Happy的楠姐
    2020-12-09 11:08

    Ways that will only remove the first The:

    =SUBSTITUTE(A1,"The ","",1) OR more reliably: 
    
    =IF(IF(LEFT(A1,4)="The ",TRUE)=TRUE,RIGHT(A1,(LEN(A1)-4)),A1)
    

    Second one is basically saying if the first left digit equals The, then check how many digits are in the cell, and show only the the right hand digits excluding The.

提交回复
热议问题