ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Find one character or another and display (https://www.excelbanter.com/excel-worksheet-functions/173560-find-one-character-another-display.html)

c8tz

Find one character or another and display
 

text string: xxx-23xz-34L or can be xxx-23exv-24R0

using the formula below, how do I put it such that if it finds an R
than it puts R else if L then it puts L.

IF((MID(G6,FIND("R",G6,1),1))="R","R","L")

trying the OR function but getting confused.

and the FIND({"R","L"}.... doesn't seem to work right.

Thanks for your help

Rick Rothstein \(MVP - VB\)

Find one character or another and display
 
How about this...

=IF(ISERROR(FIND("R",G6)),"L","R")

Of course, the usage of R and L must be confined to the characters after the last dash (where your example seems to show it has to be). If you can possibly have an R or L in one of the first two groupings of characters, then you will need a different formula.

Rick


"c8tz" wrote in message ...

text string: xxx-23xz-34L or can be xxx-23exv-24R0

using the formula below, how do I put it such that if it finds an R
than it puts R else if L then it puts L.

IF((MID(G6,FIND("R",G6,1),1))="R","R","L")

trying the OR function but getting confused.

and the FIND({"R","L"}.... doesn't seem to work right.

Thanks for your help


Fred Smith[_4_]

Find one character or another and display
 
Try something like:

=if(isnumber(find("R",a1)),"R",if(isnumber(find("L ",a1)),"L","Neither"))

Regards,
Fred

"c8tz" wrote in message
...

text string: xxx-23xz-34L or can be xxx-23exv-24R0

using the formula below, how do I put it such that if it finds an R
than it puts R else if L then it puts L.

IF((MID(G6,FIND("R",G6,1),1))="R","R","L")

trying the OR function but getting confused.

and the FIND({"R","L"}.... doesn't seem to work right.

Thanks for your help



c8tz

Find one character or another and display
 
On Jan 18, 3:54*pm, "Fred Smith" wrote:
Try something like:

=if(isnumber(find("R",a1)),"R",if(isnumber(find("L ",a1)),"L","Neither"))

Regards,
Fred

"c8tz" wrote in message

...





text string: xxx-23xz-34L or can be xxx-23exv-24R0


using the formula below, how do I put it such that if it finds an R
than it puts R else if L then it puts L.


IF((MID(G6,FIND("R",G6,1),1))="R","R","L")


trying the OR function but getting confused.


and the FIND({"R","L"}.... doesn't seem to work right.


Thanks for your help- Hide quoted text -


- Show quoted text -


thanks heaps for both of your help. got what i wanted.


All times are GMT +1. The time now is 04:24 PM.

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