=mid function

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Patient A - 1234
Patientabc Babc - 9876

I need the next column to contain 1234 and 9876.

Thanks! Kyli
 
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.
 
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
 
Holy cow! Luckily for me, JE's explanation of
=RIGHT(A1,4)
worked out perfectly for me.

Thanks for your assistance, though!
Kyli
 
Back
Top