Nested If Statement

M

mjb2005

I know this is going to be so easy, but I just cannot get this to work.
In one cell I have a name for example "SMITH" and in another cell I
have numbers.
What I want to do is:
=IF('sheet1'!A$1:A$2000="SMITH",'sheet1'!AF$1:AF$2000,5)

eg:
a1 af1
smith 15
jackson 10
jones 20
smith 15
smith 15
jones 20

In my formula cell please just put the number 15, unless there is no
smith and in that case put 5.
Clear as mud?
Any help really would be appreciated.
Cheers
 
A

Arvi Laanemets

=IF(ISERROR(VLOOKUP("SMITH",'sheet1'!$A$1:$AF2000,32,0)),5,VLOOKUP("SMITH",'sheet1'!$A$1:$AF2000,32,0))
 

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