If Question

J

Johnnie

I am trying to get information based on a name. I tried the following
formula, but can not get it to work. Please help. Thanks.
Johnnie

In cell B7 I have the following:

=IF(B3=Brian,Sheet2!E2,if(B3=Cindy,Sheet2!E3,if(B3=David,Sheet2!E4,"")

Note: Cell B3 is a list.
 
S

Sheeloo

If you have only three names then you are on the right track..you need to put
quotes around names (text strings)

Try

=IF(B3="Brian",Sheet2!E2,if(B3="Cindy",Sheet2!E3,if(B3="David",Sheet2!E4,"")))
 
S

Shane Devenshire

Hi,

very close, instead use

=IF(B3="Brian",Sheet2!E2,if(B3="Cindy",Sheet2!E3,if(B3="David",Sheet2!E4,"")))
 
J

Johnnie

Shane,
Thanks, it works great. Two questions:
1. Do the names require the quotes because I am pulling them from a list and
2. How long can the string be? I have 35 names to incorporate into the
formula.

Johnnie
 
D

David Biddulph

The names need to be in quotes because that is how Excel denotes a text
string.
If rather than "How long can the string be?" you intended to ask how many IF
statements can be nested together in this way, the answer is only 7 for
Excel 2003. If you've got more than that the recommendation is usually to
use the VLOOKUP function instead of nested IFs. Excel help will give you
examples as to how to use VLOOKUP, and there are plenty of recommendations
in the archive of this newsgroup.
 

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