SMALL function returning 2 values

brownrice

New Member
Joined
Feb 24, 2015
Messages
8
Hi folks, I am trying to use the SMALL function in a conditional statement to highlight only the 2nd smallest value in a row. In the same array I am using a contitional successfully to highlight the lowest value using "bottom 1."
When I add SMALL (=SMALL(e2:k2,2)) to return the 2nd smallest value, though, it returns both 2nd and 3rd smallest values. Not sure what I am doing wrong! Thanks!
Also do you know how to stop Excel from "helpfully" adding formula values when I move the arrow keys as I am writing a formula? It is just dumping random stuff in there! All I want to do is move the cursor. Thank you!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Press f2 while editing.

Either you have two matching values, or you forgot to make the ranges absolute, I suspect.
 
Upvote 0
I don't have matching values, they are all different. Now it is returning everything except the highest value! I am not able to upload the mini-sheet because I can't find 'XL2BB" add in, but I included an image. the orange highlight is what is supposed to be only 2nd lowest value. The green, the lowest value, works fine.
 

Attachments

  • formula.png
    formula.png
    4.9 KB · Views: 5
Upvote 0
Did you make the range absolute, like Rory said?

If you are applying your original formula to all the columns in that row, you need to make the column part of your references absolute by changing this:
Excel Formula:
=SMALL(e2:k2,2)
to this:
Excel Formula:
=SMALL($e2:$k2,2)

See here for a detailed explanation of relative, absolute, and mixed range references.
 
Upvote 0
Did you make the range absolute, like Rory said?

If you are applying your original formula to all the columns in that row, you need to make the column part of your references absolute by changing this:
Excel Formula:
=SMALL(e2:k2,2)
to this:
Excel Formula:
=SMALL($e2:$k2,2)

See here for a detailed explanation of relative, absolute, and mixed range references.
Yes, that actually made it worse. Now it's highglighting the whole row. Not sure what I am doing wrong, is there maybe a different formula I can use? I have a lot of rows to apply this to. thanks for your help!
 

Attachments

  • manage rules.png
    manage rules.png
    19.6 KB · Views: 4
  • absolute formula.png
    absolute formula.png
    2.4 KB · Views: 4
Upvote 0
Whoops, I think there needs to be another part of that formula, if we want to check if the value in that cell is the second smallest in that range.

If you select the range E2:K2, and then apply this Conditional Formatting formula:
Excel Formula:
=SMALL($E2:$K2,2)=E2
and then choose your formatting option, it should format the second smallest value in that range.
 
Upvote 0
Wouldn't that only check cell E2 though? I have a range of cells, I want to highlight the lowest rate, then also the 2nd lowest rate in that range. I assume I need 2 rules for that, and the 2nd lowest rule should be run after it checks for the lowest. Are the rules interfering with each other? I am just not sure why the original formula, which should give me only the 2nd lowest value, isn't working. I guess I could just change my original conditional to give me the bottom 2 rates instead, but that isn't quite what I'm looking for! I saw another solution that used an IF statement, but that seems to me like it shouldn't be necessary.
 
Upvote 0
Wouldn't that only check cell E2 though?
No, the E2 isn't absolute

Book1
CDEFGHIJK
21520171821121516
3810142097815
4101314151018111
5682020614313
6613820162613
75171513514192
89119157191214
93191053427
Sheet1
Cell Formulas
RangeFormula
C2:C9C2=SMALL(E2:K2,2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:K9Expression=SMALL($E2:$K2,2)=E2textNO
 
Last edited:
Upvote 0
Wouldn't that only check cell E2 though?
By NOT using the dollar sign in front of that column reference, it allows that one to float.

So, if you first select the range E2:K2, and then apply the formula I gave you hear is what Excel will actually do:

On cell E2: =SMALL($E2:$K2,2)=E2
On cell G2: =SMALL($E2:$K2,2)=G2
On cell H2: =SMALL($E2:$K2,2)=H2
etc.

See the pattern?

If you read the link I gave you, it will explain how it works but locking/not-locking certain column references.
 
Last edited:
Upvote 0
On cell E2: =SMALL($E2:$K2,2)=E2
On cell G2: =SMALL($E2:$K2,2)=F2
On cell H2: =SMALL($E2:$K2,2)=G2
etc.
Hi Joe, are you sure those references are correct?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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