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)))
  • 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

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)))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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