0
The problem is that the formula LOOK FOR returns the first occurrence of the character, while what you need is the index of the last occurrence.
To get the search behavior from right to left you need to implement this function yourself.
To create the function:
- Press Alt+F11 in the Excel spreadsheet. The VBA window will open.
- Click on the Vbaproject project name on the left
- Choose Insert > Module.
- Paste the code below into the Code Edit window that will open.
Public Function PROCURAR_DIREITA(ByVal text As String, ByRef cell As Range) As String
PROCURAR_DIREITA = InStrRev(cell.text, text)
End Function
- Go back to your spreadsheet and replace the formula where it is:
=DIREITA(C3;NÚM.CARACT(C3)-PROCURAR(".";C3))
for:
=DIREITA(C3;NÚM.CARACT(C3)-PROCURAR_DIREITA(".";C3))
Thanks, it worked!
– azhhh