Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

With Cell F1 a drop down menu, I'm trying to look up the value of A2 on sheet 2 and if F1 contains:

  • "Test1 1/2", then return the data in the 3rd column
  • "Test1 2/1", then return the data in the 4th column
  • "Test2 1/2", then return the data in the 5th column
  • "Test2 2/1", then return the data in the 6th column.

I was able to figure it out using a total of four if functions, except the equation shows "wrong number of arguments to IF":

=IF(F1="Test1 1/2",vlookup(A2,Sheet11!A2:F,3,false),
 IF(F1="Test1 2/1",vlookup(A2,Sheet11!A2:F,4,false)),
 IF(F1="Test2 1/2",vlookup(A2,Sheet11!A2:F,5,false)),
 IF(F1="Test2 2/1",vlookup(A2,Sheet11!A2:F,6,false)))
share|improve this question
    
Please share a doc with us and show us the expected outcome. VLOOKUP is the correct direction, but shifting them into columns is another thing. –  Jacob Jan Tuinstra Apr 11 '13 at 5:50
    
I went ahead and figured it out on my own. Trial and error, with some searching. –  Brian Apr 11 '13 at 6:49
3  
Perhaps you can answer your own question? That perfectly normal here on Web Applications. We might learn from it !! –  Jacob Jan Tuinstra Apr 11 '13 at 7:03
    
I've prepared an example file for you, to show you how the VLOOKUP formula works: goo.gl/nfP6K –  Jacob Jan Tuinstra Apr 13 '13 at 20:35

1 Answer 1

According to OP (who seems unlikely to post an answer as such):

Here is the correct equation:

=IF(F1="Test1 1/2",vlookup(A2,Sheet11!A2:F,3,false),IF(F1="Test1 2/1",vlookup(A2,Sheet11!A2:F,4,false),IF(F1="Test2 1/2",vlookup(A2,Sheet11!A2:F,5,false),IF(F1="Test2 2/1",vlookup(A2,Sheet11!A2:F,6,false)))))
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.