If(count()) question

rockhopper

New Member
Joined
Mar 26, 2009
Messages
4
I'm trying to add the top seven values from 20 columns of numbers (represented by "Races", but all columns may not have values in them. When <7 columns have numbers, sum just all of them. The function I've written is below, but is now working:

=IF(COUNT(Races >6), SUM(LARGE(Races, 1), LARGE(Races, 2), LARGE(Races, 3), LARGE(Races, 4), LARGE(Races, 5), LARGE(Races, 6), LARGE(Races, 7) ), SUM(Races))

Please Help!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Is Races multiple rows? Or is it just 1 row? And if it's multiple rows, you want the 7 largest column sums, correct?
 
Upvote 0
Is there some reason this won't work instead?

Excel Workbook
ABCDEFGHIJKLMNOPQRST
1Data 1Data 2Data 3Data 4Data 5Data 6Data 7Data 8Data 9Data 10Data 11Data 12Data 13Data 14Data 15Data 16Data 17Data 18Data 19Data 20
247122019528837186848735395547618124883
31758883008201315691098688733983855758
44988572831237980579953564660763551515
5789995152218483176574729195177889234
624951595352482773215688204368559497705
79285687299048764656473149730239617965
83951621611847755877274175381162123869
958394620665726957958612026051647387259
10786402170550968353885976905108855212910
11
12
13Sum:6846
141988
152986
163983
174980
185976
196968
207965
Sheet1
 
Upvote 0
After fighting this for a couple hours, I fought it some more. I swear my logic was correct, but it wasn't working. Anyways, thanks. Here's what ended up working for me, my >6 was placed count(races >6):

=IF(COUNT(Races) >6, SUM(LARGE(Races, {1,2,3,4,5,6,7}) ), SUM(Races))
 
Upvote 0
What I don't get is why you even use the IF. You want the 7 biggest values. Empty cells will be zeroes. Why not just make the formula:
=SUM(LARGE(Races, {1,2,3,4,5,6,7}))
 
Upvote 0
When I tried to sum the 7 largest values when there was less the 7, I was getting an error, so I had to create case for a racer who had less then 7 races.
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,790
Members
448,994
Latest member
rohitsomani

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