Find Min Value in Range Excluding 0 and Hidden Cells

mike2246

New Member
Joined
Jan 13, 2015
Messages
26
Cell A100 Find Min of A2-A99 excluding 0's and Hidden rows. I found a website that shows how to do this for average by making a VB Module and it works perfect, just not sure how to change this to a Min Value.

Website Reference for Avg VB Code

Or this could also work in my situation if it could be done through conditional formatting, doing a gradient scale of lowest value that ignore's 0's and hidden cells.
 
Last edited:

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Do you need code?

With a formula

=AGGREGATE(15,7,1/(1/A2:A99),1)
 
Upvote 0
Using option 7 as the second argument of AGGREGATE does ignore hidden rows.

edit:-

Correction, option 7 is supposed to ignore hidden rows, it doesn't appear to work as it is meant to. I'll be back shortly with a new formula.
 
Last edited:
Upvote 0
Unfortunately I don't think it ignores hidden rows, when using an array.
 
Upvote 0
Yeah, that's correct, Fluff. This works though

=AGGREGATE(15,6,1/(1/SUBTOTAL(4,OFFSET(A2,ROW(A2:A99)-1,0,1,1))),1)
 
Upvote 0
Yeah, that's correct, Fluff. This works though

=AGGREGATE(15,6,1/(1/SUBTOTAL(4,OFFSET(A2,ROW(A2:A99)-1,0,1,1))),1)

I'd suggest:

=AGGREGATE(15,6,1/(1/SUBTOTAL(4,OFFSET(A2,ROW(A2:A99)-ROW(A2),0,1,1))),1)

otherwise it would ignore A2.
 
Upvote 0
Good catch Eric, I started at A1 then changed it and forgot to correct the adjustment.
 
Upvote 0
Still not working using updated formula, Value of A2 = 2, It still shows minimum as 2 even if row is hidden
 

Attachments

  • Capture.PNG
    Capture.PNG
    39.8 KB · Views: 5
Upvote 0
If you're using an actual filter, the formula should work ok. But if you are manually hiding a row, try this version:

=AGGREGATE(15,6,1/(1/SUBTOTAL(104,OFFSET(A2,ROW(A2:A99)-1,0,1,1))),1)
 
Upvote 0

Forum statistics

Threads
1,215,362
Messages
6,124,502
Members
449,166
Latest member
hokjock

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