Extracting text from a string

  • Thread starter Thread starter durbat2
  • Start date Start date
D

durbat2

I have a spreadsheet which imports data in the form R/IVE/0458 I need
to extract data to read IVE 0458 an added complication being that some
times there are 5 digits ie R/IVE/40755 which needs to read IVE 40755

Hope this makes sense, thanks in anticipation

Martin
 
Try:

=MID(A1,FIND("/",A1)+1,255)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
Hi,
You could use Edit > Replace, but you'd have to use it twice.
1st time: Replace R/ with nothing. Replace all.
2nd time: Replace / with a space. Replace all.
Regards - Dave
 
I have a spreadsheet which imports data in the form R/IVE/0458 I need
to extract data to read IVE 0458 an added complication being that some
times there are 5 digits ie R/IVE/40755 which needs to read IVE 40755

Hope this makes sense, thanks in anticipation

Martin

If all of your desired data begins after R/, then:

=SUBSTITUTE(MID(A1,3,255),"/"," ")

If all of your desired data begins after the first "/", and there can be more
than one character before it, then:

=SUBSTITUTE(MID(A1,FIND("/",A1)+1,255),"/"," ")

--ron
 
With your extracted value in A1

Try this:
B1: =MID(SUBSTITUTE(A1,"/"," "),3,255)

Is that something you can work with?
Post back if you have more questions.

Regards,

Ron
Microsoft MVP - Excel
 
OK so you guys can read better then me <g>

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
I have a spreadsheet which imports data in the form R/IVE/0458 I need
to extract data to read IVE 0458 an added complication being that some
times there are 5 digits ie R/IVE/40755 which needs to read IVE 40755

Hope this makes sense, thanks in anticipation

Martin


Try this:

=SUBSTITUTE(SUBSTITUTE(A1,"R/",""),"/"," ")

This first replaces the R/ with nothing and then replace the / with a
a single space.

Hope this helps / Lars-Åke
 
If all of your desired data begins after R/, then:

=SUBSTITUTE(MID(A1,3,255),"/"," ")

If all of your desired data begins after the first "/", and there can be more
than one character before it, then:

=SUBSTITUTE(MID(A1,FIND("/",A1)+1,255),"/"," ")

--ron

Thanks this worked a treat and will save me a lot of time at work

Martin
 

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

Back
Top