Max/Min function -- ignore blank cells

PortoMarco

New Member
Joined
Jul 10, 2014
Messages
21
Hi

How can I get my max function (and subsequently my min function) to ignore blank cells?

Here is my function:

=MAX(IF(Return!$A$3:$A$306=Analysis!P$63;IF(Return!$C$3:$C$306=Analysis!$L73;IF(Return!$D$3:$D$306=Analysis!$L$60;Return!$P$3:$P$306))))

my three pre-existing conditions work fine.

I want it to return the max value in the P column (3:306) and ignore the empty cells in that range. The problem is that the cells in P3:P306 are not really empty; they all have a vlookup so I guess excel is treating the "empty" cell as actually full (the formula) and returning a zero value.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I also tried this:

=MAX(IF(Return!$A$3:$A$306=Analysis!P$63;IF(Return!$C$3:$C$306=Analysis!$L67;IF(Return!$D$3:$D$306=Analysis!$L$60;IF(ISNUMBER(Return!$P$3:$P$306);Return!$P$3:$P$306)))))
 
Upvote 0
Maybe ...

Code:
=MAX(IF((Return!$A$3:$A$306=Analysis!P$63) 
      * (Return!$C$3:$C$306=Analysis!$L73)
      * (Return!$D$3:$D$306=Analysis!$L$60) 
      * (Return!$P$3:$P$306<>0), 
      Return!$P$3:$P$306))
 
Upvote 0
No, that didn't work. I got this to work though:

=LARGE(IF(Return!$A$3:$A$306=Analysis!R$63;IF(Return!$C$3:$C$306=Analysis!$L67;IF(Return!$D$3:$D$306=Analysis!$L$60;Return!$P$3:$P$306)));1)

But the problem is that in the case where there are no observations there is a #NUM! error. I can live with that but, how can I insert an iserror into my formula so that errors come out as -- ?
 
Upvote 0
I tried this and I get the "too many arguments" error

=if(iserror(LARGE(IF(Return!$A$3:$A$306=Analysis!P$63;IF(Return!$C$3:$C$306=Analysis!$L67;IF(Return!$D$3:$D$306=Analysis!$L$60;Return!$P$3:$P$306)));1);"--";LARGE(IF(Return!$A$3:$A$306=Analysis!P$63;IF(Return!$C$3:$C$306=Analysis!$L67;IF(Return!$D$3:$D$306=Analysis!$L$60;Return!$P$3:$P$306)));1))
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,970
Members
448,933
Latest member
Bluedbw

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