using wildcard for vlookup?

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

Guest

I have a worksheet with a field I'll call function code (FC). I want to
populate a field in each row depending on what the FC is. Example, I want
this new field to be 10 if the FC begins with "40", 20 if it begins with
"412", 30 if it begins with "42" but not "423". Is this possible? Maybe
with a vba routine?
 
One way:

=IF(LEFT(fc,2)="40",10,IF(LEFT(fc,3)="412",20,IF(LEFT(fc,3)="423","",IF(LEFT(fc,2)="42",30,""))))
 

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