Using INDEX and it Returns a #N/A

C

Crazyhorse

I am using the Function INDEX and MATCH. It works. It does not work well when
you want to add up the results but the result returns a #N/A. I would like to
return a Zero instead on a #N/A. Here is my Formula that I am using.

=INDEX(Detail!$F$2:$F$1292,MATCH(1,(Detail!$A$2:$A$1292=Summary!C$5)*(Detail!$G$2:$G$1292=Summary!$A$11),0))

This returns #N/A and I would like it to return a Zero.

Thanks in Advance for any help.
 
C

Crazyhorse

Here is the answer.


=IF(ISNA(INDEX(Detail!$F$2:$F$1292,MATCH(1,(Detail!$A$2:$A$1292=Summary!R$5)*(Detail!$G$2:$G$1292=Summary!$A$10),0))),0,INDEX(Detail!$F$2:$F$1292,MATCH(1,(Detail!$A$2:$A$1292=Summary!R$5)*(Detail!$G$2:$G$1292=Summary!$A$10),0)))

It works every time.
 
P

Pete_UK

Actually, it's the MATCH part that returns #NA if there is no match,
so you could improve it slightly by having:

=IF(ISNA(MATCH(...)),0,INDEX(...MATCH(...)...))

Hope this helps.

Pete
 

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