Extracting the number from a text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
In a cell say C3, the value is such as S9(09)V(05).

the value of that cell might be in one of the following format:
(1) S(9)V(5)
(2) S9(09)V(05)
(3) S9(9)V(05)
(4) S9(09)V(5)
(5) S(11)

My requirement is: i need to get the numbers extracted which, is present
before & after the letter 'V' & enclosed in parantheses. In some cases, the
letter V may not be there. (for ex: point 5 - here, only one number is there
ie.11)

This extraction should happen ONLY if the cell E3 has the value "COMP-3."


Thanks in Advance.
Venkatesh V
 
First number:

=IF($E$3="COMP-3",MID(A1,FIND("(",A1)+1,FIND(")",A1)-FIND
("(",A1)-1),"")

Second number:

=IF(AND($E$3="COMP-3",COUNTIF(A1,"*V*")),SUBSTITUTE(MID
(A1,FIND("V",A1)+2,2),")",""),"")

HTH
Jason
Atlanta, GA
 

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