Ignore #N/A in Array Formula

r1998

Board Regular
Joined
Sep 9, 2018
Messages
106
Dear Friends and Respected Seniors,
I have this data in A1-B10
[TABLE="width: 128"]
<tbody>[TR]
[TD="width: 64, align: right"]1[/TD]
[TD="width: 64, align: right"]28[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]80[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]70[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]65[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]40[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]88[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]41[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]58[/TD]
[/TR]
</tbody>[/TABLE]

I want to find the maximum value from column B wherever column A has value 1, so in C1 I am using
Code:
=MAX(IF(A:A=A1,B:B))
with control+shift+enter
I am getting the correct answer as 40.
But if column B has any #N/A values, I get #N/A in C1, that is, if I change B8 from 33 to #N/A, I get #N/A in C1.
How can I ignore #N/A values in above formula.
Can anyone please kindly help me.
Awaiting your replies.
Thank you.
 
Last edited:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
First of all, for the sake of performance avoid references to entire columns in array formulas, so try something like this

=MAX(IF(A1:A100=A1,IF(ISNUMBER(B1:B100),B1:B100)))
Ctrl+Shift+Enter

M.
 
Upvote 0
Thank you Marcelo Branco Sir,
your formula worked perfectly :beerchug:
Henceforth, I will not use reference of entire columns :beerchug:
Thank you. :beerchug:
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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