Getting the minimum number in a range WITHOUT excluding blank cells

mcomp72

Active Member
Joined
Aug 14, 2016
Messages
308
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I was hoping to use the Excel function MIN to return the smallest number in a range. Unfortunately it's not working for me, because if one of the cells in the range is blank, I need MIN to return 0. Apparently MIN ignores any cells that are empty. Is there some other way to do this, without getting into writing a User Defined Function? I also tried the function SMALL, but that too seemed to ignore empty cells. I also Googled around for an answer, but wasn't able to find anything. This seems like something that should be pretty simple, but I haven't had any luck finding a solution. Any help would be appreciated!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
This array-entered** formula does what you want...

=MIN(0+(0&G9:G12))

**Commit this formula using CTRL+SHIFT+ENTER and not just Enter by itself
 
Upvote 0
Thanks!!

Another question: could I use this within VBA code? I was also going to use the MIN function in some VBA code, like so:

VBA Code:
Application.WorksheetFunction.Min(rng)

where rng is a Range variable.

Could I use this type of VBA code, but have it use it like the array entered formula you posted?
 
Upvote 0
Try it this way...

MinVal = Evaluate("MIN(0+(0&" & Rng.Address & "))")
 
Upvote 0
Solution

Forum statistics

Threads
1,224,884
Messages
6,181,552
Members
453,052
Latest member
ezzat

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