#N/A logic

garethgtt

New Member
Joined
May 16, 2006
Messages
11
I have the following formula:

=INDEX(Sheet4!$C$1:$C$205,MATCH(1,(E$5=Sheet4!$A$1:$A$2216)*(B7=Sheet4!$B$1:$B$216),0))

now when it does not find a match it displays #N/A -- how can i instead get it to show either nothing or a 0

?
Many thanks
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
You need to add an "If" statement


=IF(ISERROR(INDEX(Sheet4!$C$1:$C$205,MATCH(1,(E$5=Sheet4!$A$1:$A$2216)*(B7=Sheet4!$B$1:$B$216),0))),0,INDEX(Sheet4!$C$1:$C$205,MATCH(1,(E$5=Sheet4!$A$1:$A$2216)*(B7=Sheet4!$B$1:$B$216),0)))

something like that
 
Upvote 0
Try this:

=if(isna(INDEX(Sheet4!$C$1:$C$205,MATCH(1,(E$5=Sheet4!$A$1:$A$2216)*(B7=Sheet4!$B$1:$B$216),0))),"",INDEX(Sheet4!$C$1:$C$205,MATCH(1,(E$5=Sheet4!$A$1:$A$2216)*(B7=Sheet4!$B$1:$B$216),0)))

for leaving blank.

or,

=if(isna(INDEX(Sheet4!$C$1:$C$205,MATCH(1,(E$5=Sheet4!$A$1:$A$2216)*(B7=Sheet4!$B$1:$B$216),0))),0,INDEX(Sheet4!$C$1:$C$205,MATCH(1,(E$5=Sheet4!$A$1:$A$2216)*(B7=Sheet4!$B$1:$B$216),0)))

for entering a 0.

Hope that helps,

Banjoflanjo
 
Upvote 0
I have the following formula:

=INDEX(Sheet4!$C$1:$C$205,MATCH(1,(E$5=Sheet4!$A$1:$A$2216)*(B7=Sheet4!$B$1:$B$216),0))

now when it does not find a match it displays #N/A -- how can i instead get it to show either nothing or a 0

?
Many thanks

If the formula is supposed to return a number when successful...

Control+shift+enter, not just enter:

Code:
=LOOKUP(9.99999999999999E+307,
   CHOOSE({1,2},0,INDEX(Sheet4!$C$1:$C$205,MATCH(1,
     IF(E$5=Sheet4!$A$1:$A$2216,IF(B7=Sheet4!$B$1:$B$216,1)),0))))

Note. If you are on Excel 2007 or beyond, have a look at the IFERROR function.
 
Upvote 0
If the formula is supposed to return a number when successful...

Control+shift+enter, not just enter:

Code:
=LOOKUP(9.99999999999999E+307,
   CHOOSE({1,2},0,INDEX(Sheet4!$C$1:$C$205,MATCH(1,
     IF(E$5=Sheet4!$A$1:$A$2216,IF(B7=Sheet4!$B$1:$B$216,1)),0))))

Note. If you are on Excel 2007 or beyond, have a look at the IFERROR function.


Thanks very much!
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top