Using =SUM(SMALL to count but omitting Zero

GMC The Macro Man

Board Regular
Joined
Mar 23, 2023
Messages
104
Office Version
  1. 2021
Platform
  1. Windows
Hey everyone,

I'm doing a small spreadsheet for our local golf group and I'm stuck at using the =SUM(SMALL formula.
The golfers play FIVE rounds and the calculation is their BEST FOUR scores from the five. In golf, it's the LOWEST score that counts so I wrote this formula
=SUM(SMALL(B4:F4,1)+SMALL(B4:F4,2)+SMALL(B4:F4,3)+SMALL(B4:F4,4))

This works great if the golfer attended all five outings and returned a score, however, if they missed an outing, then a ZERO is recorded. This throws a wobbly as the formula counts the zero as one of the lowest scores.
How can i amend the formula not to count zero's. I tried this but it gave an error
=SUMIF(SMALL(B4:F4,"<>0",1)+SMALL(B4:F4,"<>0",2)+SMALL(B4:F4,"<>0",3)+SMALL(B4:F4,"<>0",4))

Thanks as always
GMC

Best Golf Rounds.xlsx
ABCDEFG
12024 CLUB Championship
2
3PLAYERKINGS ACRELOUDOUN GCAUCHTERARDERHIRSELTHORNTONBEST 4 RDS
4Player 16373696869269
5Player 268670750135
6Player 36870757270280
7Player 4707007672212
8Player 5727608168216
9Player 675737100144
10Player 776790780154
11Player 8788408470232
12Player 9790778072228
13Player 10807385760229
14Player 118473828786325
15Player 12807383810234
16Player 138282857581320
17Player 14927976810236
18Player 158683807571309
19Player 16848480081245
20Player 1797008989178
21Player 18081800080
22Player 19083810081
23Player 20069740069
Sheet1
Cell Formulas
RangeFormula
G4:G23G4=SUM(SMALL(B4:F4,1)+SMALL(B4:F4,2)+SMALL(B4:F4,3)+SMALL(B4:F4,4))
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hello, would this work for you:

Excel Formula:
=LET(
a,FILTER(B4:F4,B4:F4<>0),
b,SEQUENCE(,IF(COLUMNS(a)<4,COLUMNS(a),4)),
SUM(SMALL(a,b)))
 
Upvote 1
What do you want to do if they played fewer than the 4 rounds? Given that lowest score is best, it doesn't really seem fair to include players who only have say 3 rounds as they will (probably!) have a lower total.
 
Upvote 1
Adding a 0 and summing nothing is exactly the same. What are you expecting the result to be?
BTW, I think you could change your formula to this:
=SUM(SMALL(B4:F4,{1,2,3,4}))

I don't have older versions of Excel anymore, you may need CTRL-SHIFT-ENTER for that.
 
Upvote 1
Actually, since there's only 5, you could also SUM them and subtract out the largest one:
=SUM(B4:F4,-MAX(B4:F4))
 
Upvote 1
What do you want to do if they played fewer than the 4 rounds? Given that lowest score is best, it doesn't really seem fair to include players who only have say 3 rounds as they will (probably!) have a lower total.
Hi RoryA,
You make a fair point here but as there are only 20 players in our golf section we have always been able to manage this manually. There are 5 outings and they all have a lot of manual input over several pages so I wanted to put formulas where possible to make it easier.
My initial plan was to put conditional formatting on anyone who had a "0", and make that cell RED. A quick scan would allow you to see who had more than two zero's and would therefore not be included but It would be better if the TOTAL column could calculate the best FOUR of the FIVE rounds and then SORT in order. That's a calculation for another day then 😊
 
Upvote 0
You could amend the Best 4 formula to return something else instead, like "Not enough rounds" rather than an actual score?
 
Upvote 0
For example:

Excel Formula:
=IF(COUNTIF(B4:F4,">0")<4,"Not enough rounds",SUM(SMALL(B4:F4,{1,2,3,4})))
 
Upvote 1
Solution
Hello, would this work for you:

Excel Formula:
=LET(
a,FILTER(B4:F4,B4:F4<>0),
b,SEQUENCE(,IF(COLUMNS(a)<4,COLUMNS(a),4)),
SUM(SMALL(a,b)))
Hey there. Many thanks for looking at my question and giving me your solution. I really appreciate you taking the time to do this.
Thanks again
GMC
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,566
Members
452,652
Latest member
eduedu

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