Can I search a cell for a value and extract part of content?

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

Guest

I want to test a cell using something like a "substring" looking for 5
characters. If I find a match I want to capture an use the 4 postion numeric
value in another cell. Example: A1 contains "SALES 4567". I want to test
cell A1 for "SALES" and If I find the value "SALES" I want to capture the
numeric value "4567" in cell N1.

Thanks, JOHN
 
Try in N1:

=IF(ISNUMBER(SEARCH("SALES",A1)),SUBSTITUTE(A1,"SALES","")+0,"")

Replace SEARCH with FIND
if you need the check on the text to be case sensitive
 

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