delimit using a formula

L

laandmc

I am wanting to delimit a cell with both text and numbers in to separate out
the numbers which have common characters that delimit them from the rest of
the text.

I can do this using text to columns but I want to know whether I can do this
by using a formula instead.##e.g.

A
1 text (2/3) more text
2 text (3/4) more text

I want to get the results:

A B
1 2 3
2 3 4

using the first delimiter "(", then "/" then ")"

is there a way to write this in a formula to split up the numbers from the
text?

Cheers
 
P

Paul C

for the first number use this
=MID(A1,FIND("(",A1)+1,FIND("/",A1)-FIND("(",A1)-1)
for the second number use this
=MID(A1,FIND("/",A1)+1,FIND(")",A1)-FIND("/",A1)-1)

Both of these work regardless of how long the numbers are (so (20/30) would
be retured as 20 and 30).

This does assume no extra spaces within the (1/2) expression
 
L

laandmc

You are a legend thanks very much!

Paul C said:
for the first number use this
=MID(A1,FIND("(",A1)+1,FIND("/",A1)-FIND("(",A1)-1)
for the second number use this
=MID(A1,FIND("/",A1)+1,FIND(")",A1)-FIND("/",A1)-1)

Both of these work regardless of how long the numbers are (so (20/30) would
be retured as 20 and 30).

This does assume no extra spaces within the (1/2) expression
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top