ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Delimit using a formula 2 (https://www.excelbanter.com/excel-discussion-misc-queries/258037-delimit-using-formula-2-a.html)

laandmc

Delimit using a formula 2
 
I am using the functions

=MID(A1,FIND("(",A1)+1,FIND("/",A1)-FIND("(",A1)-1) and
=MID(A1,FIND("/",A1)+1,FIND(")",A1)-FIND("/",A1)-1)

to get a couple of numbers out of a cell which use the delimiters (, /, and )
e.g. text (2/3) more text

I am using this to pull out odds from a betting site, however if the odds
are displayed as just a whole number e.g. (2) this is not working

Is there a way to put an if function in or something to say "if the cell
contains an "/" character do the original formula, if not do a slightly
altered formula only containing "(" and ")".

Please see my post "Delimit using a formula" for further details, any help
would be greatly appreciated.

Thanks

Fred Smith[_4_]

Delimit using a formula 2
 
This way:
=if(isnumber(find("/",a1)),"has slash","no slash")

Regards,
Fred

"laandmc" wrote in message
...
I am using the functions

=MID(A1,FIND("(",A1)+1,FIND("/",A1)-FIND("(",A1)-1) and
=MID(A1,FIND("/",A1)+1,FIND(")",A1)-FIND("/",A1)-1)

to get a couple of numbers out of a cell which use the delimiters (, /,
and )
e.g. text (2/3) more text

I am using this to pull out odds from a betting site, however if the odds
are displayed as just a whole number e.g. (2) this is not working

Is there a way to put an if function in or something to say "if the cell
contains an "/" character do the original formula, if not do a slightly
altered formula only containing "(" and ")".

Please see my post "Delimit using a formula" for further details, any help
would be greatly appreciated.

Thanks



Queso hotmail com>

Delimit using a formula 2
 
Sure. Assuming you want the singular answer in the first formula and the
second formula to not even run:
=IF(FIND("/",A1),MID(A1,FIND("(",A1)+1,FIND("/",A1)-FIND("(",A1)-1),MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND("(",A1)-1))
and
=IF(FIND("/",A1),MID(A1,FIND("/",A1)+1,FIND(")",A1)-FIND("/",A1)-1),"")
--
Please remember to indicate when the post is answered so others can benefit
from it later.


"laandmc" wrote:

I am using the functions

=MID(A1,FIND("(",A1)+1,FIND("/",A1)-FIND("(",A1)-1) and
=MID(A1,FIND("/",A1)+1,FIND(")",A1)-FIND("/",A1)-1)

to get a couple of numbers out of a cell which use the delimiters (, /, and )
e.g. text (2/3) more text

I am using this to pull out odds from a betting site, however if the odds
are displayed as just a whole number e.g. (2) this is not working

Is there a way to put an if function in or something to say "if the cell
contains an "/" character do the original formula, if not do a slightly
altered formula only containing "(" and ")".

Please see my post "Delimit using a formula" for further details, any help
would be greatly appreciated.

Thanks


gjlinker

Delimit using a formula 2
 
I have built some text functions into my Excel functions library litLIB that may be handy: SplitText, TextBetween.

Gerrit-Jan Linker
Author of LITLIB

---
frmsrcurl: http://msgroups.net/microsoft.public...ng-a-formula-2


All times are GMT +1. The time now is 02:45 PM.

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