Smallest value greater than zero across multiple cells

dsmith1088

New Member
Joined
Aug 31, 2017
Messages
11
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
 

dsmith1088

New Member
Joined
Aug 31, 2017
Messages
11
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).
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
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
Joined
Aug 31, 2017
Messages
11
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.

Thank you for your help
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
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.

Thank you for your help
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.
 

ANAND KUMAR

New Member
Joined
Oct 20, 2016
Messages
41
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
Joined
Aug 31, 2017
Messages
11
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
Joined
Oct 20, 2016
Messages
41
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
 

Forum statistics

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

Some videos you may like

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...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top