# Microsoft Excel - Adding up - Asked By Joe Ryan on 18-Apr-12 08:09 PM

Back for more help.
I have 8 rows with 8 different numbers (8 cells) and I want to add the four largest numbers into a cell any ideas
Venkat K replied to Joe Ryan on 18-Apr-12 10:30 PM
If you want to do with Excel formulaes, it simple
1. Sort the range in decending order.
2. Use the SUM Function to add the first four cells.

If you want to do in VBA, you can use the sort function as below:

Range(Cells(1, "B"), Cells(2, NumCount)).Sort Key1:=Cells(1, NumCount)

Pichart Y. replied to Joe Ryan on 18-Apr-12 10:42 PM
Hi Joe,

Assume that you 8 numbers are in C2:C9 and there is 1 pair of 7.
• Input this formula
• =LARGE(\$C\$2:\$C\$9,1)&", "&LARGE(\$C\$2:\$C\$9,2)&", "&LARGE(\$C\$2:\$C\$9,3)&", "&LARGE(\$C\$2:\$C\$9,4)
• You will get 8, 7, 7, 6
• attachment for you -->Fml_find4MaxNumbers.zip

Hope this help.

Pichart Y.

Pichart Y. replied to Joe Ryan on 18-Apr-12 10:47 PM
Hi Joe,

Or if you want to sum them, use this formula
• =SUM(LARGE(\$C\$2:\$C\$9,1),LARGE(\$C\$2:\$C\$9,2),LARGE(\$C\$2:\$C\$9,3),LARGE(\$C\$2:\$C\$9,4))
• Sample attachment --> Fml_find4MaxNumbers.zip

Pichart Y.

Joe Ryan replied to Pichart Y. on 19-Apr-12 06:39 PM
So added a example, it might make it clearer what I want Help.zip

Pichart Y. replied to Joe Ryan on 19-Apr-12 06:52 PM
Hi Joe,

I have question...if there are 5 same largest number, will we sum only 4 ...or else please suggest..

pichart Y
Joe Ryan replied to Pichart Y. on 19-Apr-12 09:09 PM
only want to total 4 numbers, they could be the same,
Pichart Y. replied to Joe Ryan on 19-Apr-12 09:41 PM
Hi Joe Ryan,

So, the formula I provide in my last attachment is what you can use, please try it and let me know your feedback.

Remark: If the ranges of your data are always 8 lines, you can copy the formula to apply in all calculation cells.

Pichart Y.
Joe Ryan replied to Pichart Y. on 23-Apr-12 05:42 AM
Hi Pichart Y

Thanks alot, worked perfect, would your formula work if there were only 6 numbers ?
Pichart Y. replied to Joe Ryan on 23-Apr-12 07:05 AM
Hi Joe,

You are welcome!!!

Yes!!, but...
You need to adjust the range in the formula....
• From =SUM(LARGE(D3:D10,1),LARGE(D3:D10,2),LARGE(D3:D10,3),LARGE(D3:D10,4))
• to =SUM(LARGE(D3:D8,1),LARGE(D3:D8,2),LARGE(D3:D8,3),LARGE(D3:D8,4))
That's all.

pichart Y.
Joe Ryan replied to Pichart Y. on 23-Apr-12 09:51 AM
Hi Pichart Y

Thanks alot, saved me a bunch of time.
Pichart Y. replied to Joe Ryan on 23-Apr-12 11:01 AM
Hi Joe,

You are welcome, see you here again.

Pichart Y.