View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pecoflyer[_199_] Pecoflyer[_199_] is offline
external usenet poster
 
Posts: 1
Default #VALUE! error when trying to add cells (VLOOKUP)


sandy;247981 Wrote:
Thanks to everyone for your help.

Pecoflyer,

When I used your formula instead of mine I got the same results. Is it
better to use COUNTIF vs. ISNA ?

"Pecoflyer" wrote:


sandy;247089 Wrote:
I am trying to add cells that have been filled with the VLOOKUP
function.

=SUM(F6+I6+L6+O6+R6+T6)

Those cells have a value from a VLOOKUP function

=IF(ISNA(VLOOKUP(Q6,Points!$K$5:$L$28,2)),"
",VLOOKUP(Q6,Points!$K$5:$L$28,2))

If there is nothing in one of the cells I get the #VALUE! error

(it
works if
there is a number there). What am I doing wrong?


And to lighten the burden on the calculations try

=IF(countif(points!$k$5:$k$28,Q6),VLOOKUP(Q6,Point s!$K$5:$L$28,2),"")


--
Pecoflyer

Cheers -
*'Membership is free' (http://www.thecodecage.com)* & allows file
upload -faster and better answers

*Adding your XL version* to your post helps finding solution faster

------------------------------------------------------------------------
Pecoflyer's Profile: 'The Code Cage Forums - View Profile: Pecoflyer'

(http://www.thecodecage.com/forumz/me...pecoflyer.html)
View this thread: '#VALUE! error when trying to add cells (VLOOKUP) -

The Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...ad.php?t=68952)



Well in this case there are two evaluations
first Vlookup, which can be heavy on calculations
then ISNA which evaluates the results

Countif only evaluates once and only returns TRUE or FALSE

So, if you have lots of Vlookups, Countif will be faster
If you don't, I think it doesn't matter


--
Pecoflyer

Cheers -
*'Membership is free' (http://www.thecodecage.com)* & allows file
upload -faster and better answers

*Adding your XL version* to your post helps finding solution faster
------------------------------------------------------------------------
Pecoflyer's Profile: http://www.thecodecage.com/forumz/member.php?userid=14
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=68952