ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Reverse Find (https://www.excelbanter.com/excel-discussion-misc-queries/152557-reverse-find.html)

snax500

Reverse Find
 
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


Dave O

Reverse Find
 
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)


Don Guillett

Reverse Find
 
Sub findlast()
For Each c In Range("e1:e2")
p = Len(c) - InStrRev(c, " ") + 1
MsgBox p
Next
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"snax500" wrote in message
ps.com...
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



David Hilberg

Reverse Find
 
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

On Aug 1, 10:24 am, snax500 wrote:
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




David Hilberg

Reverse Find
 
See also: http://j-walk.com/ss///excel/usertips/tip079.htm

- David

On Aug 1, 10:24 am, snax500 wrote:
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





All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com