Pull SECOND MINIMUM VALUE from a range meeting certain conditions

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,215
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
My 'actual' range is AC38:BH38 which contains values or "" & I want to get the Second MINIMUM VALUE from this 'actual' range in final cell address HF38.
There is a helper row $AC$58:$BH$58 which contains "Y" to certify that the corresponding cells in the above row 38 contains values & not "" & ALSO to certify that from these cells only the
Second MINIMUM VALUE has to be pulled. This helper row $AC$58:$BH$58 does not contain any -ve values although it contains "".

For getting: the Second MINIMUM VALUE in HF38, I used HF38=MIN((ABS(IFERROR(VALUE(AC38:BH38),1)+1))*IF(AC38:BH38="",999^9,1)*IF(AC38:BH38>HD38,1,999^9)*IF($AC$58:$BH$58="Y",1,999^9))-1 only to get HF38=9.91036E+26 !!!

What should be the formula used? This is required in HF38.
Thanks in adv.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I want to pull Second MINIMUM VALUE from the 'actual' range i.e. AC38:BH38 meeting 2 conditions:

1. Value pulled from the cell>0
2. where the value in the corresponding cell in the
helper row i.e. $AC$58:$BH$58 MUST contain "Y"

Note: In my previous thread #2, HD38=MINIMUM VALUE from the 'actual' range i.e. AC38:BH38.
 
Upvote 0
1. 999^9 doesn't make sense, if not non-sense; put otherwise, it's someone's mystery you appear to adopt.

2. Control+shift+enter, not just enter:

=IFERROR(SMALL(IF(ISNUMBER(AC38:BH38),IF(AC38:BH38>0,AC38:BH38)),2),"N/A")
 
Upvote 0
Above formula returns Second MINIMUM VALUE from the 'actual' range i.e. AC38:BH38. But it meets 1st condition & not the 2nd. While pulling Second MINIMUM VALUE from the 'actual' range i.e. AC38:BH38, it should consider those cells ONLY where the value in the corresponding cell in the helper row i.e. $AC$58:$BH$58 IS "Y".
 
Upvote 0
Above formula returns Second MINIMUM VALUE from the 'actual' range i.e. AC38:BH38. But it meets 1st condition & not the 2nd. While pulling Second MINIMUM VALUE from the 'actual' range i.e. AC38:BH38, it should consider those cells ONLY where the value in the corresponding cell in the helper row i.e. $AC$58:$BH$58 IS "Y".

Why do you call it helper row at all if it's an independent condition range?

Control+shift+enter, not just enter:

=IFERROR(SMALL(IF(ISNUMBER(AC38:BH38),IF(AC38:BH38>0,IF($AC$58:$BH$58="Y",AC38:BH38))),2),"N/A")
 
Upvote 0
=IFERROR(SMALL(IF(ISNUMBER(AC38:BH38),IF(AC38:BH38>0,IF($AC$58:$BH$58="Y",AC38:BH38))),2),"N/A")[/QUOTE]

Probably, a better way to....
Little difference in understanding: Your formula gives Second Minimum as per occurrence & I need second minimum UNIQUE...pardon me if I am unclear here to explain. In below table, instead of row#43, kindly consider row#58. Minimum is ALREADY 15 in AE36, so I don't wan't 15 (AH36) (as second minimum). Next Minimum is 19 in AI36. This I want to pull.
Sheet1

ACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBK
35I needYour formula
36203015abc221519-0.1t887715520019211915
37
38
39
40
41
42
43YYYYYYYYYYYY

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
BK36{=IFERROR(SMALL(IF(ISNUMBER(AC36:BH36),IF(AC36:BH36>0,IF($AC$43:$BH$43="Y",AC36:BH36))),2),"N/A")}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>
 
Last edited:
Upvote 0
Now that we have full specs...

Control+shift+enter, not just enter:
Rich (BB code):
=SMALL(IF(IF(FREQUENCY(IF(ISNUMBER(1/AC38:BD38),
  IF(AC38:BD38>0,MATCH(AC38:BD38,AC38:BD38,0))),
  COLUMN(AC38:BD38)-COLUMN(AC38)+1),
  TRANSPOSE(COLUMN(AC38:BD38)-COLUMN(AC38)+1)),
  TRANSPOSE($AC$38:$BD$38)),2)
 
Upvote 0
Now that we have full specs...

Control+shift+enter, not just enter:
Rich (BB code):
=SMALL(IF(IF(FREQUENCY(IF(ISNUMBER(1/AC38:BD38),
  IF(AC38:BD38>0,MATCH(AC38:BD38,AC38:BD38,0))),
  COLUMN(AC38:BD38)-COLUMN(AC38)+1),
  TRANSPOSE(COLUMN(AC38:BD38)-COLUMN(AC38)+1)),
  TRANSPOSE($AC$38:$BD$38)),2)

I changed it a little....
=SMALL(IF(IF(FREQUENCY(IF(ISNUMBER(1/AC42:BH42),IF(AC42:BH42>0,MATCH(AC42:BH42,AC42:BH42,0))),COLUMN(AC42:BH42)-COLUMN(AC42)+1),TRANSPOSE(COLUMN(AC42:BH42)-COLUMN(AC42)+1)),TRANSPOSE($AC$56:$BH$56)),2)
but I get 0 instead of a number!!!
 
Upvote 0
Control+shift+enter, not just enter:
Rich (BB code):
=SMALL(IF(IF(FREQUENCY(IF(ISNUMBER(1/AC38:BD38),
  IF(AC38:BD38>0,MATCH(AC38:BD38,AC38:BD38,0))),
  COLUMN(AC38:BD38)-COLUMN(AC38)+1),
  TRANSPOSE(COLUMN(AC38:BD38)-COLUMN(AC38)+1)),
  TRANSPOSE($AC$38:$BD$38)),2)
[/QUOTE]

Aladin, Please convey...Is your formula taking care of the 2nd condition i.e. "where the value in the corresponding cell in the row $AC$58:$BH$58 IS "Y"?

I am asking this because the formula neither contain $AC$58:$BH$58 nor "Y" .
I need second minimum UNIQUE
 
Upvote 0

Forum statistics

Threads
1,215,945
Messages
6,127,844
Members
449,411
Latest member
adunn_23

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