If Statements w/vlookup

Copper Contributor

Other excel lovers,

 

I'm trying to string some IF statements along, using vlookups as well. I want to select value from the audits list to perform a vlookup, pulling the data from the table below.

 

So if I select "Pallet Heights" from the audit list, it looks at the location in A13, finds that in the table below, and returns the correct column in the table.

 

Seems simple and I can get it to work up until the third IF statement when it all starts unraveling. I just can't seem to understand how the logic works when you want to do three or more IF statements.

 

Any help is appreciated!

3 Replies

@Koonies 

As you have some positions to trace/choose I would suggest another simple formula.

OFFSET(Reference,RowPosition,ColumnPosition)

To get these positions (Row and Col) you can use the formula Match()

Translating for your file needs the following formula will return your desirable result:

=OFFSET(play[[#Headers],[Location]],MATCH(A13,play[Location],0),MATCH(F4,play[#Headers],0)-1)

All your columns name must to be equal what you are looking for. No abbreviations 

If you want to use IF statement, the following formula will work as well

=VLOOKUP(A13,play,IFS(C4=F4,D4,C5=F4,D5,C6=F4,D6,C7=F4,D7,C8=F4,D8,C9=F4,D9),0)

Or perhaps some elegant alternative

=VLOOKUP(A13,play,SUMPRODUCT((C4:C9=F4)*(D4:D9)),0)

 

Now you have some other options to choose

@Juliano-Petrukio 

 

Thanks for your help! That worked wonderfully.

@Koonies 

You're welcome, By the way don't be shy on hit the like button and don't forget to mark as Official/Best Answer to help the other members find it too.