Sumproduct #N/A elminate?

N

na

I am using the following forumla:

=SUMPRODUCT(--(Sheet2!$D$2:$D$396>DATE(2004,6,15)),--(Sheet2!$D$2:$D$396<=DATE(2004,7,15)),Sheet2!$G$2:$G$396)+SUMPRODUCT(--(Sheet2!$K$2:$K$396>DATE(2004,6,15)),--(Sheet2!$K$2:$K$396<=DATE(2004,7,15)),Sheet2!$N$2:$N$396)

The question is: How do I omit cells within the range that have #N/A
(because data hasn't been entered in that cell to make the function work)?

Thanks
 
F

Frank Kabel

Hi
easiest way would be to change the formulas which creates the #NA. what
formula are you using in these cells
 
N

na

In the first sumproduct Column G has the following:
=E40*(VLOOKUP(F40,Airfare,2,FALSE))

in the second sum product columan N has: =VLOOKUP(M2,Airfare,3,False)
 
A

Aladin Akyurek

na said:
In the first sumproduct Column G has the following:
=E40*(VLOOKUP(F40,Airfare,2,FALSE))

in the second sum product columan N has
=VLOOKUP(M2,Airfare,3,False)...

If Airfare is sorted on its first column, use the faster:

=E40*IF(VLOOKUP(F40,Airfare,1,1)=F40,VLOOKUP(F40,Airfare,2,1),0)

Otherwise, you have to resort to costly...

=E40*IF(ISNA(VLOOKUP(F40,Airfare,2,FALSE)),0,VLOOKUP(F40,Airfare,2,FALSE)
 
N

na

Thanks - the second one worked for me!

Aladin Akyurek said:
If Airfare is sorted on its first column, use the faster:

=E40*IF(VLOOKUP(F40,Airfare,1,1)=F40,VLOOKUP(F40,Airfare,2,1),0)

Otherwise, you have to resort to costly...

=E40*IF(ISNA(VLOOKUP(F40,Airfare,2,FALSE)),0,VLOOKUP(F40,Airfare,2,FALSE))
 

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

Top