Adding 7 highest numbers

S

Stu

Hi all

This sounds like it should be easy but for the life of me I cant work it
out.

What I have is a row of numbers and I have to add the 7 highest value
numbers out of a possible 9 otherwise just add what ever is in the row

for instance
row 1 contains 94, 96, 91, 92, 95, 90, 96, 98 total should equal 662
row 2 contains 96, 97, 93, 93, 96, 91, 97 total should equal 663
row 3 contains 95, 95, 92, 94, 94, 92 total should equal 562

any help would be gratefully appreciated

Stu
 
D

Dave Peterson

One way:

=SUM(LARGE(A1:I1,ROW(INDIRECT("1:"&MIN(7,COUNT(A1:I1))))))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

or if there could be 0 entries:

=IF(COUNT(A1:I1)=0,"",
SUM(LARGE(A1:I1,ROW(INDIRECT("1:"&MIN(7,COUNT(A1:I1)))))))
(one cell and still an array formula)
 
G

Guest

If your amounts are in columns A through I, try using this:

H1:
=SUM(LARGE(I1:INDEX(A1:I1,LARGE(IF(A1:I1<>"",COLUMN(A:I)),MIN(7,COUNT(A1:I1)))),ROW(INDIRECT("1:"&MIN(7,COUNT(A1:I1))))))

Note: To commit that array formula hold down [Ctrl] and [Shift] when you
press [Enter]

Then copy that formula down.

Does that help?

••••••••••••••••
Regards,
Ron
 
R

Ron Rosenfeld

Hi all

This sounds like it should be easy but for the life of me I cant work it
out.

What I have is a row of numbers and I have to add the 7 highest value
numbers out of a possible 9 otherwise just add what ever is in the row

for instance
row 1 contains 94, 96, 91, 92, 95, 90, 96, 98 total should equal 662
row 2 contains 96, 97, 93, 93, 96, 91, 97 total should equal 663
row 3 contains 95, 95, 92, 94, 94, 92 total should equal 562

any help would be gratefully appreciated

Stu

You could use the **array** formula:

=SUM(LARGE(rng,ROW(INDIRECT("1:"&MIN(7,COUNT(A1:I1))))))

where rng is where your numbers are entered.

To enter an **array** formula, hold down <ctrl><shift> while hitting <enter>.
Excel will place braces {...} around the formula.


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top