Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Wormburner -
If the lookup always returns a number 5 greater, try this: =VLOOKUP($A7,$A$4:$I$3000,($J$1+5),FALSE) Otherwise, if $J$1 is always a small integer, you can use a CHOOSE function, like this: =VLOOKUP($A7,$A$4:$I$3000,CHOOSE($J$1,6,7,8,9),FAL SE) -- Daryl S "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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
vlookup with if statement? | Excel Discussion (Misc queries) | |||
Not sure whether to use VLOOKUP or an IF statement | Excel Worksheet Functions | |||
using vlookup within an if statement | Excel Worksheet Functions | |||
If statement with Vlookup | Excel Worksheet Functions | |||
VLOOKUP with IF statement | Excel Discussion (Misc queries) |