Reverse Find

  • Thread starter Thread starter snax500
  • Start date Start date
S

snax500

I want to use the Find function but I want to get the result going
from right to left. For example if I am searching for a space " ",

Steve Scott 75 - I want the find to return 3 NOT 6
Al Smith 4 - I want the find to return 2 Not 3

How can I modify this

FIND(" ",A1)

Thanks
 
This will work, if there are ALWAYS two blanks in the cell. It works
by nesting a Find within a Find, starting the outer Find using the
inner Find as a parameter. It subtracts that result from the overall
length of the string itself, adding 1 to account for the non-zero
start.

=LEN(A1)+1-FIND(" ",A1,FIND(" ",A1,1)+1)
 
Sub findlast()
For Each c In Range("e1:e2")
p = Len(c) - InStrRev(c, " ") + 1
MsgBox p
Next
End Sub
 
Searching A1 for the character in C1:

=MAX((MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)=C1)
*ROW(INDIRECT("1:"&LEN(A1))))

(array-enter this formula with Ctrl + Shift+ Enter)

- David
 
Back
Top