View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Using IF statement in a VLOOKUP

You seem to be adding 5 onto J1 as long as J1 is 1 to 4. So, you could
reduce the number of IFs like this:

=VLOOKUP($A7,$A$4:$I$3000,IF(AND($J$1=1,$J$1<=4), 5+$J$1,1),FALSE)

The IF returns 1 if J1 is not valid, which in turn will return the
lookup value ($A7). There is no error checking here to see if A7 does
exist in A4:A3000 (which it obviously does !!).

Hope this helps.

Pete

On Feb 16, 4:01*pm, wormburner
wrote:
I created a VLOOKUP that includes an IF statement. However, I need to be able
to reference 4 possible scenarios not only 2. Currently
,(IF($J$1=1,6,(IF($J$1=2,7)))) works. I need it to also ask IF($J$1=3,8) and
IF($J$1=4,9) in some sort of formula.

I have provided my formula below.

=VLOOKUP($A7,$A$4:$I$3000,(IF($J$1=1,6,(IF($J$1=2, 7)))),FALSE).

Any help will be appreciated.