Sum column exclude cells which have maximum for row

Hudco

Board Regular
Joined
Jan 4, 2006
Messages
125
Office Version
  1. 365
Almost New Year so best wishes for 2023.
I have a sheet with 12 columns and 250 rows of data which contain numbers in either 1,2,3,4 or 5 cells spread variously across the columns. I have created a 13th column with a formula counting the number of cells in each row with a number. A 14th column then extracts the maximum value in the rows where the count number in the 13th column is greater than 3.

I am wanting to sum the amounts in each column where the value in the 13th column is >3. I can do this successfully with a SUMIF formula [=SUMIF($M$4:$M$255,">3",A$4:A$255)]. But what I want to do is exclude the maximum value of any row of the 12 columns with more than 3 cells with numbers in that row. As stated above, I have extracted the maximum value of each row of the 12 columns however I cannot seem to create a formula to add the columns excluding the se values should they occur in the column being totalled.

The data are quarterly fees, or annual fees, or twice annual etc. and I want to get a value for each type of fee for each month.

Thanking you in anticipation
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
See if this (using smaller range) is what you want. I have added colour for my own checking. The column sums should exclude the orange cells because the row has less than 3 numbers and the yellow cells because they are the highest value in the rows with 3 or more numbers.

For the future I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

23 01 01.xlsm
ABCDEFGHIJKLMN
445435554214115
5315415132443125
6412 
715434565
80 
93325333385
102532552223105
1111 
1242442164
132512244445105
14213425542141125
15243251543552125
161213511532105
1714151265
1821232432422114
19442 
20222222222222122
21
222312142416762422162720
Sum with exclusions
Cell Formulas
RangeFormula
M4:M20M4=COUNT(A4:L4)
N4:N20N4=IF(M4>=3,MAX(A4:L4),"")
A22:L22A22=SUM(FILTER(A4:A20,($M4:$M20>2)*(A4:A20<>$N4:$N20)))
 
Upvote 0
Solution
Thanks Peter,

And thank you for the info about XL2BB, have downloaded and will install. I will also read up on Filter.

All the very best for the New Year.

Clyde
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,773
Messages
6,126,821
Members
449,340
Latest member
hpm23

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