Formula using index and match to find smallest/minimum value > zero

already999

New Member
Joined
Feb 19, 2025
Messages
4
Office Version
  1. 2010
Platform
  1. Windows
Hi,
I have the following formula to find the max and min value in a column:

=(MAX(Data!B:B)&" - "&MIN(IF(Data!B:B>0;(Data!B:B))))

But I want to find the corresponding cell in another column using index and match. But I can’t figure it out to find the smallest value greater than zero in this formula

=INDEX(Data!A:A;MATCH(MIN(Data!B:B);Data!B:B;0))

Thanks in advance for your help
 
as you are using 2010 , you can use MINIFS

try
=INDEX(A1:A1000,MATCH(SMALL(B1:B1000,COUNTIF(B1:B1000,0)+1),B1:B1000,0))

Book1
ABC
1dateorder
22/1/2502/4/25
32/2/2512
42/3/250
52/4/256
6
Sheet1
Cell Formulas
RangeFormula
C2C2=INDEX(A1:A1000,MATCH(SMALL(B1:B1000,COUNTIF(B1:B1000,0)+1),B1:B1000,0))


for reference - finding smallest value ignoring zero
 
Upvote 0
as you are using 2010 , you can use MINIFS

try
=INDEX(A1:A1000,MATCH(SMALL(B1:B1000,COUNTIF(B1:B1000,0)+1),B1:B1000,0))

Book1
ABC
1dateorder
22/1/2502/4/25
32/2/2512
42/3/250
52/4/256
6
Sheet1
Cell Formulas
RangeFormula
C2C2=INDEX(A1:A1000,MATCH(SMALL(B1:B1000,COUNTIF(B1:B1000,0)+1),B1:B1000,0))


for reference - finding smallest value ignoring zero
Hi Etaf,

Thanks for your suggestion but if I'm right there is no MINIFS formula in version 2010.

Kr.
 
Upvote 0
ok hence why i used small and count

should have said CANT, missed the T out - sorry
 
Upvote 0
Welcome to the MrExcel board!

I don't know if it is possible with your data but the post #2 formula would return an incorrect result if negative values can also exist in column B.
That formula could be adapted to account for such circumstances as shown in D2 below and another option is given in C2.

25 02 19.xlsm
ABCD
1dateorder
21/02/202503/02/20253/02/2025
32/02/202512
43/02/20252
54/02/2025-6
already999
Cell Formulas
RangeFormula
C2C2=INDEX(A2:A1000,MATCH(AGGREGATE(15,6,B2:B1000/(B2:B1000>0),1),B2:B1000,0))
D2D2=INDEX(A1:A1000,MATCH(SMALL(B1:B1000,COUNTIF(B1:B1000,"<=0")+1),B1:B1000,0))
 
Upvote 0
Welcome to the MrExcel board!

I don't know if it is possible with your data but the post #2 formula would return an incorrect result if negative values can also exist in column B.
That formula could be adapted to account for such circumstances as shown in D2 below and another option is given in C2.

25 02 19.xlsm
ABCD
1dateorder
21/02/202503/02/20253/02/2025
32/02/202512
43/02/20252
54/02/2025-6
already999
Cell Formulas
RangeFormula
C2C2=INDEX(A2:A1000,MATCH(AGGREGATE(15,6,B2:B1000/(B2:B1000>0),1),B2:B1000,0))
D2D2=INDEX(A1:A1000,MATCH(SMALL(B1:B1000,COUNTIF(B1:B1000,"<=0")+1),B1:B1000,0))
Thnks for this top update Peter_SSs. Kr Al
 
Upvote 0
you are welcome, and glad people like Peter+SSs are around to check on things and be able to check and correct anything overlooked
 
Upvote 0

Forum statistics

Threads
1,226,795
Messages
6,193,047
Members
453,772
Latest member
aastupin

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