PDA

View Full Version : EXCEL USING IF THEN STATEMENT



Tenspeed39355
06-30-2008, 05:04 AM
Good morning guys. I think this is the statement I want to use.
If Cell B3= "#/N/A" I would like to use the VLookup command to do the following. VLookup(A3,Sheet2!A2:B10,2,0) How do I set up the formula
to accomplish this? Thanks again for any help with this.
Max

marshybid
06-30-2008, 05:13 AM
Good morning guys. I think this is the statement I want to use.
If Cell B3= "#/N/A" I would like to use the VLookup command to do the following. VLookup(A3,Sheet2!A2:B10,2,0) How do I set up the formula
to accomplish this? Thanks again for any help with this.
Max
Hi,

I think your formula should read;

=IF(ISNA(B3),VLOOKUP(A3,SHEET2!A2:B10,2,0),"")

Marshybid

Tenspeed39355
06-30-2008, 07:05 AM
Thanks for your quick reply. I have a question. What is ISNA?
When a fund does not have a symbol the program I am using which is
QMatrix looks over in Yahoo and brings back #N/A. If the fund has a symbol
the program looks in Yahoo and brings back the fund price like $10.23
When the fund does not have a symbol the return is #/N/A. When the
return is #N/A then I want VLookup to do it thing.
I am thinking the formula should look something like this.
=IF(B3="#n/a"),vlookup(A3,Sheet2!A2:B10,2,0),"")
This does not work so can you give me the formula that will work?
Thanks
Max

marshybid
06-30-2008, 07:15 AM
If #N/A is returned as part of a formula in excel, then you can use ISNA. If the #N/A in your cells is seen as text then you should use;

=IF(B3="#N/A",VLOOKUP(A3,SHEET2!A2:B10,2,0),"")

or

=IF(B3<>"#N/A"," ",VLOOKUP(A3,SHEET2!A2:B10,2,0)

A simple test would be to write the following formula into c3 (assuming b3 contains #N/A, it should return "YES";

=IF(ISNA(B3),"YES","NO")

Marshybid