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
128
220
380
370
265
140
288
133
341
258

<tbody>
</tbody>

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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
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 (y)
Henceforth, I will not use reference of entire columns (y)
Thank you. (y)
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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