# Smallest value greater than zero across multiple cells

#### dsmith1088

##### New Member
Hi all

I'm trying to sum the smallest value greater than zero across multiple (scattered/random) cells. I know how to do this if the cells were in straightforward row or column range, but not sure what the best way is across random cells. Any ideas?

Many thanks

##### MrExcel MVP
Which cells? Would you name some of these?

#### dsmith1088

##### New Member
For example:

A1 = 3,000
A26 = 2,000
A38 = 0
A50 = 1,500

I need a formula that looks across each of those 4 cells and returns the lowest value greater than zero i.e. A50 (1,500).

##### MrExcel MVP
For example:

A1 = 3,000
A26 = 2,000
A38 = 0
A50 = 1,500

I need a formula that looks across each of those 4 cells and returns the lowest value greater than zero i.e. A50 (1,500).
Control+shift+enter, not just enter:

=MIN(IF(CHOOSE(ROW(INDIRECT("1:"&COUNT(A1,A26,A38,A50))),A1,A26,A38,A50)>0,CHOOSE(ROW(INDIRECT("1:"&COUNT(A1,A26,A38,A50))),A1,A26,A38,A50)))

#### dsmith1088

##### New Member
Oh! I thought it was going to be simpler than that, but thank you. That has worked. I didn't think I would need to reference the cells so many times.

##### MrExcel MVP
Oh! I thought it was going to be simpler than that, but thank you. That has worked. I didn't think I would need to reference the cells so many times.

You are welcome.

You have a point though. If MS would include a native function set like SETV/GETV Longre has designed, we would have:

MIN(IF(SETV(CHOOSE(ROW(INDIRECT("1:"&COUNT(A1,A26,A38,A50))),A1,A26,A38,A50))>0,GETV()))

Adding a native version of his INTVECTOR would make life even easier.

But, alas.

• Andrew Fergus

#### ANAND KUMAR

##### New Member
See if this works,

=MIN(IF(A1:A50>0,A1:A50))

Please note that array processing, So use with ctrl+shift+enter.

Last edited:

#### dsmith1088

##### New Member
Hi

Thanks for your reply. Yes that would work across a continuous array of cells, but my cells are scattered i.e they are not adjacent to each other.

#### ANAND KUMAR

##### New Member
Hi

Thanks for your reply. Yes that would work across a continuous array of cells, but my cells are scattered i.e they are not adjacent to each other.

A quick way is possible to deal with scattered cells. Define a Name Range and pass this name through formula.

Say I have created a Name Range from \$A\$1:\$L\$15 and nominate this reference with MYRange.

Then formula becomes;-

=MIN(IF(MyRange>0,MyRange)) with CSE.

See Sample - https://ibb.co/fxhtD7

@ ANAND KUMAR

See post #4 .

1,082,151
Messages
5,363,430
Members
400,736
Latest member
Aida

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...