wildcard use in formulas

G

Guest

I am using Excell 2003

I'm trying to set up an "IF" formula in one cell to to assign office
location to postcode located in another cell. for example
=IF(A1="BD*","Bradford","Leeds"
Where the * is a wildcard. The formula doesn't allow this however, as it
looks at only what is typed into the A1 cell. For a Bradford return I have
had to type BD* in A1. My aim is for an automatic listing of the appropriate
office once the post code is typed into the preceding cell. I may be going
about this the wrong way.

I would be grateful of any help
 
B

Bob Phillips

=IF(LEFT(A1,2)="BD","Bradford","Leeds")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
D

Dave Peterson

I'd use Bob's formula, too, but one way using the wildcard:

=IF(COUNTIF(A1,"BD*")>0,"Bradford","Leeds")

==
But if you have lots of these postal codes, I'd create a table on another sheet.

A B
BD Bradford
LD Leads
xx whatever
....

=vlookup(left(a1,2),sheet2!a:b,2,false)
 

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

Top