ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   LARGE (https://www.excelbanter.com/excel-worksheet-functions/209278-large.html)

Fesk

LARGE
 
Hi
I'm using the following function to sum the best 14 numbers from 16.

=SUM(LARGE(B20:Q20,{1,2,3,4,5,6,7,8,9,10,11,12,13, 14}))

My problem is if there are less than 14 numbers the function comes up with
'#NUM'

Any help would be appreciated.
Thanks
Fesk

Mike H

LARGE
 
Try,

=SUM(LARGE(B20:Q20,ROW(INDIRECT("1:"&MIN(COUNT(B20 :Q20),14)))))

'This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"Fesk" wrote:

Hi
I'm using the following function to sum the best 14 numbers from 16.

=SUM(LARGE(B20:Q20,{1,2,3,4,5,6,7,8,9,10,11,12,13, 14}))

My problem is if there are less than 14 numbers the function comes up with
'#NUM'

Any help would be appreciated.
Thanks
Fesk


Gary''s Student

LARGE
 
=IF(COUNT(B20:Q20)<15,SUM(B20:Q20),your_formula)
--
Gary''s Student - gsnu200812

Mike H

LARGE
 
I should have added an equivalent of your formula without the less than 14
numbers issue is this. Still an array but a bit less unweildy

=SUM(LARGE(B20:Q20,ROW(INDIRECT("1:14"))))

Mike

"Mike H" wrote:

Try,

=SUM(LARGE(B20:Q20,ROW(INDIRECT("1:"&MIN(COUNT(B20 :Q20),14)))))

'This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"Fesk" wrote:

Hi
I'm using the following function to sum the best 14 numbers from 16.

=SUM(LARGE(B20:Q20,{1,2,3,4,5,6,7,8,9,10,11,12,13, 14}))

My problem is if there are less than 14 numbers the function comes up with
'#NUM'

Any help would be appreciated.
Thanks
Fesk


Fesk

LARGE
 
Gary & Mike H

Thanks for the help, worked brilliantly.

Fesk


All times are GMT +1. The time now is 07:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com