Sumif and Small functions help

Bengmark

New Member
Joined
May 2, 2018
Messages
2
I'm struggling with what I think should be a simple function. Hoping someone can help.

I want to use a Sumif focusing on the name. i.e. =SUMIF(B2:B29,"Brett",H2:H29). This equals 57.2
But I only want to smallest 3 numbers. i.e. =SUM(SMALL(H2:H29,{1,2,3})). This equals 1.64

So I thought I would be able to do this. =SUMIF(B2:B29,"Brett",SMALL(H2:H29,{1,2,3}))

But I get an error. I've tried using Sumifs as well. Same result. Shouldn't I be able to embed the small command in the sum range? I'm using Excel 2013.


B H
PlayerHandicap
Brett12.35961
Sam8.802885
Srihdar4.356984
Vivek3.467803
Brett7.024525
Sam8.802885
Srihdar4.356984
Vivek3.467803
Brett8.802885
Sam8.802885
Srihdar4.356984
Vivek3.467803
Brett5.246164
Sam7.858394
Srihdar3.587528
Vivek2.733354
Brett9.56674
Sam7.858394
Srihdar3.587528
Vivek2.733354
Brett7.173677
Sam6.233552
Srihdar2.185791
Vivek1.376239
Brett7.043104
Sam6.233552
Srihdar2.185791
Vivek1.376239


<tbody>
</tbody>
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Nope. SUMIF(S) doesn't work like that.
Try this regular formula:
Code:
=SUMPRODUCT(SMALL((B2:B29="Brett")*H2:H29,{1,2,3}+COUNTIF(B2:B29,"<>Brett")))
Is that something you can work with?
 
Upvote 0
Thanks Ron. This looks like it works exactly like I need. I had not used the SUMproduct function before.

Thanks again.
Brett
 
Upvote 0
This looks like it works exactly like I need.
Welcome to the MrExcel board!

I guess with a heading like "Handicap" it may not be possible with your data, but that formula would fail if it was possible that Brett could have any negative values in column H.

If you are interested, I think this formula also does what you want (& would also cope if negatives can exist).
It is an array formula so should be entered without the surrounding {} but confirmed with Ctrl+Shift+Enter, not just Enter. If confirmed correctly, Excel will insert the {}

Code:
{=SUM(SMALL(IF(B2:B29="Brett",H2:H29,""),{1,2,3}))}
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,823
Members
449,049
Latest member
cybersurfer5000

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