# Question about a Google Spreadsheet function (I don't even think of how to describe it in the title)

Pretty much what I'm trying to accomplish is the following:

Cell `F1` is a drop down menu.

If `F1` contains the words "whatever", then look up the word in A2 on sheet 2, and input the data in 3rd column.

If F1 contains the words "whatever /1", then look up the word in A2 on sheet 2, and input the data in the 4th column.

If F1 contains the words "whatever /2", then look up the word in A2, on sheet 2, and input the data in the 5th column.

Etc, etc.

I'm guessing I don't need to use the if function, but I'm sure I need to use vlookup.

EDIT:

I was able to figure it out, using a total of 4 IF equations, but when I do, it says "wrong number of arguments to IF".

Here is the 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)))
``````

Edit: I figured it out, apparently I have to "nest" the IFs?

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

(Pretty much changing the parenthesis.)

I'm going to leave this up, just in case someone Google searches for it.

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