Forum Discussion

VaibsP's avatar
VaibsP
Copper Contributor
Feb 09, 2023
Solved

Search for the position of the last occurrence of a specific character in a text

I have to search for the position of the last occurrence of a specific character in a text. For example, in the below text I want to know the position of the last occurrence of character "/" abc.co...
  • mtarler's avatar
    Feb 09, 2023

    VaibsP Here are 2 options:

    using Excel365:

    =LEN(TEXTBEFORE(A1,"/",-1))+1

    older version:

    =LEN(A1)-LEN(TRIM(MID(SUBSTITUTE(A1,"/",REPT(" ",LEN(A1))),(LEN(A1)-LEN(SUBSTITUTE(A1,"/","")))*LEN(A1),LEN(A1))))

     

     

     

Resources