Max/Min function -- ignore blank cells

PortoMarco

New Member
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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
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)))))

Min and Max both ignore blank cells. Are you just masking a 0 as blank?

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))``````

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

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

Use IFERROR. =IFERROR(LARGE(.....),"--")

Replies
2
Views
142
Replies
8
Views
288
Replies
11
Views
496
Replies
2
Views
74
Replies
0
Views
131

1,203,453
Messages
6,055,533
Members
444,794
Latest member
HSAL

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.

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

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