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.
 

Some videos you may like

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.

PortoMarco

New Member
Joined
Jul 10, 2014
Messages
21
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)))))
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,779
Office Version
  1. 2010
Platform
  1. Windows
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))
 

PortoMarco

New Member
Joined
Jul 10, 2014
Messages
21

ADVERTISEMENT

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 -- ?
 

PortoMarco

New Member
Joined
Jul 10, 2014
Messages
21
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))
 

C Moore

Well-known Member
Joined
Jan 17, 2014
Messages
544
Office Version
  1. 365
Platform
  1. Windows
Use IFERROR. =IFERROR(LARGE(.....),"--")
 

Watch MrExcel Video

Forum statistics

Threads
1,122,672
Messages
5,597,488
Members
414,146
Latest member
marginmakerb

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
Top