Try:
![]()
=IF(CODE(LEFT(B1))>CODE(LEFT(A1)),CODE(LEFT(B1))-CODE(LEFT(A1))+IF(MID(B1,3,255)="right",1,0),CODE(LEFT(A1))-CODE(LEFT(B1))+IF(MID(A1,3,255)="right",1,0))
Note: The Code() function is sensitive to case... I.e. both letters in A1 and B1 have to be the same case or you will get erroneous results...
If you want to ensure the same case...surround each cell reference within the CODE() function with the UPPER() function... e.g. CODE(LEFT(UPPER(A1)))
Bookmarks