if and vlookup formula combination

Joined
Sep 28, 2011
Messages
3
Reaction score
0
I am trying to combine an if statement with a vlookup and I can't seem to make it work correctly. (performing just the vlookup works fine!)
I only want the vlookup to occur if the "If" statement is correct, else I want it to be 0.

In cell K4 I want the following formula: If cell E4 = 5, then perform the following vlookup =vlookup(F4,'Input Data'!D:K,8, False), else return a zero.

Thanks to whoever can help me!
Sally
 
Joined
Sep 3, 2008
Messages
164
Reaction score
5
sblojax,

=if(E4=5,vlookup(F4,'Input Data'!D:K,8, False),"0") should work. The syntax for an if formula is: Condition, value if true, value if false.

I do not have your data to test. In my test using a value for f4 that was not in the range returned #N/A

Stoneboysteve
 
Joined
Sep 28, 2011
Messages
3
Reaction score
0
Thanks for the help. That does work for the cells that have a hard coded value... but, the specific cells that are in question, are a formula based on INDEX - sorry i failed to mention that in the first email. Can you possibly help me with that??

I have attached a sample of the file for you to see what I am trying to do.
Thanks in advance!
 

Attachments

  • Forecasting Tool.zip
    542.3 KB · Views: 1,259
Joined
Sep 28, 2011
Messages
3
Reaction score
0
After many hours of tedious work - I have figured it out!!!

In case anyone needs something similar, here is the formula that ended up working for me!!!

For cell H4 I used: =IF(INDEX('Input Data'!$B:$AI,$C4,11)=4,(VLOOKUP($E4,'Input Data'!$D:$K,8, FALSE)),0)

For cell I4 I used: =IF(INDEX('Input Data'!$B:$AI,$C4,11)="w",(VLOOKUP($E4,'Input Data'!$D:$K,8, FALSE)),0)

and so on.....

P.S. I also had to perform a "text to columns" for column L on the Input Data tab so it would pick up the "W".....

Thanks!!
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
Thanks for reporting back with the solution, it's always a help for other users who have the same problem :).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top