=mid function

G

Guest

I need to use the mid function, but counting from the right to left. I know
it's generally: =mid(cell, start #, # of characters)

I need to go: =mid(right(cell, # of characters))
or something to that extent. Please help. : )

Thanks, Kyli
 
G

Guest

Give us an example of some data and what you want to extract from that data,
all excel find/search functions start from the left but I am sure it can be
done regardless


Regards,

Peo Sjoblom
 
G

Guest

Patient A - 1234
Patientabc Babc - 9876

I need the next column to contain 1234 and 9876.

Thanks! Kyli
 
J

JE McGimpsey

If the values will always be 4 digits:

=RIGHT(A1, 4)

If not,

=MID(A1, FIND("-",A1)+2,255)

where 255 is just a large number.
 
G

Guest

Does it always end with a number (no letter after the number) and you always
want the number? If so you can use

=--MID(A1,MATCH(TRUE,ISNUMBER(--MID(A1,ROW(INDIRECT("1:"&LEN(A1)))
+1,1)),0),255)

entered with ctrl + shift, if there is always a hyphen and a space and then
the number it is easier

=--MID(A1,FIND("-",A1)+2,255)

if you want text representation just remove the -- in the front



and finally if the numbers are always together but can be in different
places you can use


=--MID(A1,MATCH(FALSE,ISERROR(--MID(A1,ROW(INDIRECT("1:100")),1)),0),100-SUM(--ISERROR(1*MID(A1,ROW(INDIRECT("1:100")),1))))

entered with ctrl + shift & enter


regards,

Peo Sjoblom
 
G

Guest

Awesome! That worked out just right. (Um, no pun was really intended...)
Thank-you! Kyli
 
G

Guest

Holy cow! Luckily for me, JE's explanation of
=RIGHT(A1,4)
worked out perfectly for me.

Thanks for your assistance, though!
Kyli
 

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