Getting the minimum number in a range WITHOUT excluding blank cells

mcomp72

Active Member
Joined
Aug 14, 2016
Messages
305
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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,223,923
Messages
6,175,391
Members
452,640
Latest member
steveridge

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