Highlight the lowest 5

iancl23

New Member
Joined
Feb 18, 2025
Messages
6
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
How do I highlight the 5 values (used in the sum) in this formula =SUMPRODUCT(SMALL(IF(MOD(COLUMN(B3:U3),2)=1,B3:U3),{1,2,3,4,5}))
I've tried typing this formula in to conditional formatting however it won't work, BTW I'm a complete novice using formulas in excel
Regards Ian
 
Welcome to the forum Ian,

Select B3:U3 and use such formula to create a rule for conditional formatting:
Excel Formula:
=AND(B3<=SMALL(IF(MOD(COLUMN($B3:$U3),2)=1,$B3:$U3),5),MOD(COLUMN(B3),2)=1)
Note that if you could have duplicates in row 3 the formula shall be more complicated (then you shall decide which values shall be highlighted - these from left side?). Anyway may be the values do not repeat, or if they do, you can have more than 5 highlighted by Conditional Formatting.

Book1
ABCDEFGHIJKLMNOPQRSTUV
1
2
32468101214161820135191715131197
4
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:U3Expression=AND(B3<=SMALL(IF(MOD(COLUMN($B3:$U3);2)=1;$B3:$U3);5);MOD(COLUMN(B3);2)=1)textNO
 
Upvote 0
Thanks for your speedy reply, I'll give that a go when I'm back Infront of my laptop, Is there a way to apply this formula to a number of rows in a table or will I have to do them all separately?
Thanks Ian
 
Upvote 0
Welcome to the MrExcel board!

Do columns B:U have headings? If so, what are they? Headings can often simplify and/or make more robust formulas that need to reference every nth column.
Here is an example. The benefit of this type of formula is that if a column is inserted (or deleted) at the left of the data, the correct values would still be highlighted.

25 02 18.xlsm
BCDEFGHIJKLMNOPQRSTU
1JanFebMarAprMayJunJulAugSepOct
2BudgetActualBudgetActualBudgetActualBudgetActualBudgetActualBudgetActualBudgetActualBudgetActualBudgetActualBudgetActual
32468101214161820135191715131197
41313114156201515810113208202065
5156171733151218374724371714
6151531581281491191546101614171813
Lowest 5
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:U6Expression=AND(B$2="Actual",B3<=SMALL(FILTER($B3:$U3,$B$2:$U$2="Actual"),5))textNO
 
Upvote 0
This is the spreadsheet I'm working on, the Best 5 is the lowest 5 values in the points columns the weight is the sum of the weights of the 5 lowest points in the adjacent column ( this is a sum I do manually because I'm not god enough to do a formula for this lol, There are a total of 36 rows.
The fill is done manually at the moment
Regards Ian
 

Attachments

  • Screenshot 2025-02-18 122532.png
    Screenshot 2025-02-18 122532.png
    98.8 KB · Views: 13
Upvote 0
So I assume this shall always be just 5 cells.
And Adam Wakelin, who has 6 marked blue is just a mistake.
But let's see on James Dent. He has got three 10s and you marked just one in the middle (round 5) but not round 4 or 7. Any rule here?
 
Upvote 0
Adam is indeed a mistake,
James is counting a 10 as one of his lowest 5 it could be any of the three of them
Regards Ian
 
Upvote 0
The conditional formatting formula can be for sure shortened. Especially if you decide to give up with Excel 2013 and stick to 365.
Anyway, it seems it's working as expected now.

It's a long one. Select B3 to U_lastline and apply formating rule based on formula:

Excel Formula:
=AND(B$2="Points";OR(AND((COUNTIFS($B3:$U3;"<" & SMALL(IF($B$2:$U$2="Points";$B3:$U3);5);$B$2:$U$2;"Points")+COUNTIFS($B3:B3;SMALL(IF($B$2:$U$2="Points";$B3:$U3);5);$B$2:B$2;"Points"))<=5;B3=SMALL(IF($B$2:$U$2="Points";$B3:$U3);5));B3<SMALL(IF($B$2:$U$2="Points";$B3:$U3);5)))


Book1
ABCDEFGHIJKLMNOPQRSTU
1Round1Round2Round3Round4Round5Round6Round7Round8Round9Round10
2AnglerWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPoints
321611012141181011051017101310910
41313114156101515810113208202065
5156171733151218374724371714
6151531581281491191546101614171813
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:U6Expression=AND(B$2="Points";OR(AND((COUNTIFS($B3:$U3;"<" & SMALL(IF($B$2:$U$2="Points";$B3:$U3);5);$B$2:$U$2;"Points")+COUNTIFS($B3:B3;SMALL(IF($B$2:$U$2="Points";$B3:$U3);5);$B$2:B$2;"Points"))<=5;B3=SMALL(IF($B$2:$U$2="Points";$B3:$U3);5));B3<SMALL(IF($B$2:$U$2="Points";$B3:$U3);5)))textNO
 
Upvote 0
Here is a slightly shorter one that I think works in 2013

iancl23.xlsm
BCDEFGHIJKLMNOPQRSTU
1Round1Round2Round3Round4Round5Round6Round7Round8Round9Round10
2WeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPoints
321611012141181011051017101310910
41313114156101515810113208202065
5156171733151218374724371714
6151531581281491191546101614171813
Lowest 5 (3)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:U6Expression=AND(B$2="Points",OR(B3<SMALL(IF($B$2:$U$2="Points",$B3:$U3),5),AND(B3=SMALL(IF($B$2:$U$2="Points",$B3:$U3),5),COUNTIFS($B$2:$U$2,"Points",$B3:$U3,"<"&SMALL(IF($B$2:$U$2="Points",$B3:$U3),5))+COUNTIFS($B$2:B$2,"points",$B3:B3,B3)<=5)))textNO


.. and a shorter one again for 365

iancl23.xlsm
BCDEFGHIJKLMNOPQRSTU
1Round1Round2Round3Round4Round5Round6Round7Round8Round9Round10
2WeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPointsWeightPoints
321611012141181011051017101310910
41313114156101515810113208202065
5156171733151218374724371714
6151531581281491191546101614171813
Lowest 5 (4)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3:U6Expression=LET(t,"Points",p,TAKE(SORT(FILTER($B3:$U3,$B$2:$U$2=t),,,1),,5),AND(B$2=t,B3<=MAX(p),COUNTIFS($B$2:B$2,t,$B3:B3,B3)<=COLUMNS(FILTER(p,p=B3))))textNO
 
Upvote 0

Forum statistics

Threads
1,226,837
Messages
6,193,249
Members
453,784
Latest member
Chandni

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