What's wrong with this?

  • Thread starter Thread starter Texas Aggie
  • Start date Start date
T

Texas Aggie

do you see anything wrong with this sytax? the reference cell or the logical
test (D15) is a 3 letter acronym, not a number. will that not work?

=IF(D15,VLOOKUP(D15,A3:G12,4,FALSE),"")
 
Hey Aggie,

The first argument of the IF statement must return TRUE or FALSE, so you
could do something like:

=IF(D15<>"",VLOOKUP(D15,A3:G12,4,FALSE),"")

or

=IF(LEN(D15)=3,VLOOKUP(D15,A3:G12,4,FALSE),"")

HTH,
Bernie
MS Excel MVP
 
thanks bernie.....can you define D15<>"" and LEN(D15).
i don't know what those are.

thanks.
TxAg
 
TxAg,

D15<>"" is a comparison that will return TRUE if D15's is not blank, and
FALSE if it is blank: the "" is a zero length string.

LEN(D15) will return the length of the string in cell D15: since you said it
was a three letter code, then the length should be 3, and
LEN(D15)=3 will return TRUE. If cell D15 is not filled in, it will return
FALSE, since the length of a blank cell is 0.

HTH,
Bernie
MS Excel MVP
 
Back
Top