Can =search( ) or =find( ) work from right to left?

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
not directly, but you can get it done - describe what you're trying to accomplish.

paddy
 
Upvote 0
I've found that this method is pretty effective...

If your cell is A1 then this should be the type of thing that you want to do...

=FIND(CHAR(1),SUBSTITUTE(A1,"-",CHAR(1),2))

hi-there-Dr.

P.S. The doctor is not in...

9
 
Upvote 0
Eh? What's that?
I find your formula rather inefficient and pedestrian.

Perhaps Mr. Excel can teach you some math?

You seggesting I substitute the duplicate char. with others so I can search by the uniqe but your formula does not address the QUANITY of the offending little buggers. Somtimes there are 3 dups and somtimes 5 or 6.

Try another prescription.
 
Upvote 0
Dear Dr,

"I find your formula rather inefficient and pedestrian.

Perhaps Mr. Excel can teach you some math"

No need to be rude...if you're in a position to judge the suggestion so harshly, I'm surpised you don't also find yourself in a position to solve the problem.

Again, care to give an example of what you are actually trying to accomplish.

paddy
 
Upvote 0
On 2002-11-07 17:34, Doctor Logic wrote:
Eh? What's that?
I find your formula rather inefficient and pedestrian.

Perhaps Mr. Excel can teach you some math?

You seggesting I substitute the duplicate char. with others so I can search by the uniqe but your formula does not address the QUANITY of the offending little buggers. Somtimes there are 3 dups and somtimes 5 or 6.

Try another prescription.

To address you concern about the quantity,
you could use
=FIND("@",SUBSTITUTE(A1,"f","@",LEN(A1)-LEN(SUBSTITUTE(A1,"f",""))))
to find the place of the last instance of f.
If you are searching for longer than 1 character strings, this would have to be dressed up a bit.

Another option, if memory serves, can be found by searching for key word reversetext for a UDF Aladin had posted.
This message was edited by IML on 2002-11-07 18:21
 
Upvote 0
Paddy,

My comments were directed to Mr. EH?, whom I assure you he can well take care of himself. Don't be upset if I am rude to him; he sit's right next to me and likes to think he is smarter than all you good folks on the Mr. Excel site. I told him Paddy was smarter than him because Padday was able to answer many of my questions that Mr. EH? was not, so he was jelous.

Again, don't worry about Mr. EH?. He is an annoying twit. (Unlike you, who have been very helpful many times.

The Dr.
 
Upvote 0
Dr,

Fair enuogh, altohugh there is the general tone of messages to the board to consider, irrespective of whether any particular member takes offence...

& is this solved or what? if not, post an example...

paddy
 
Upvote 0
Good stuff! Along IML's recommondation (UDF), you could paste the following in a normal module:<pre>
Function RevInStr(findin As Range, tofind As String) As Integer
' Chris Rae's VBA Code Archive - http://chrisrae.com/vba
Dim findcha As Integer
For findcha = Len(findin) - Len(tofind) + 1 To 1 Step -1
If Mid(findin, findcha, Len(tofind)) = tofind Then
RevInStr = findcha
Exit Function
End If
Next findcha
' Defaults to zero anyway (tsk, tsk, etc)
End Function</pre>

And use it as such:
Book4
ABCD
1test*this*hello1015
2blah.sjdksa.sadjka.1919
3blah.sjdksa.sadjka.019
4dshkjfs-gh-hjh-j1516
Sheet1


_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2002-11-07 18:39
 
Upvote 0
Capital piece of code from Nate. (Sure wish I knew how to write VB!)

As for Paddy's example, here is the contents of a cell:

WIRE THHN-10-TAN-19STR-CU-500S/R

I would like to return everything after the last - . I can write nested serches for "-" as the silly Mr. EH? suggests except not all the cells have the same amount of "-" in them, so you nest the find for one incidence? two? five? Mr. EH? knows this so he is just being annoying. I want the formula to work on all the cells. If the formula found the FIRST incidence of "-" FROM THE RIGHT instead of the left, it would work perfect.

I suppose I could write a big formula or use multiple ajacent columns to do it but I always try to get it all into ONE cell and (if at all possible) with a FUNCTION rather than a formula.

I was just hoping. :(
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top