You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Facing "Number Outside Valid Range" error in Numbers

Uses the following formula, SUM(LARGEEST(B14:I14;{1;2;3;4;5})), to sum the 5 highest values ​​

in a series. Unfortunately it doesn't work. Getting the following error message.

The formula contains a number outside the valid range.

What could be wrong?


[Re-Titled by Moderator]

iMac 27″, macOS 14.5

Posted on Aug 14, 2024 1:25 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 14, 2024 1:21 PM

SUM(LARGE(B14:I14;{1;2;3;4;5})) might work in Excel (as an array formula) but not in Numbers. You only have five of them to add so you can add them up the old way:


=LARGE(B14:I14;1)+LARGE(B14:I14;2)+LARGE(B14:I14;3)+LARGE(B14:I14;4)+LARGE(B14:I14;5)


I am assuming "LARGEEST" was actually the "LARGE" function.

8 replies
Question marked as Top-ranking reply

Aug 14, 2024 1:21 PM in response to Pugge

SUM(LARGE(B14:I14;{1;2;3;4;5})) might work in Excel (as an array formula) but not in Numbers. You only have five of them to add so you can add them up the old way:


=LARGE(B14:I14;1)+LARGE(B14:I14;2)+LARGE(B14:I14;3)+LARGE(B14:I14;4)+LARGE(B14:I14;5)


I am assuming "LARGEEST" was actually the "LARGE" function.

Aug 16, 2024 10:16 AM in response to Badunit

> This may not give you the same answer as summing the 5 largest values


I did mention that in my answer, noting that the original post wasn't clear what to do in this case.


If you want the sum of all cells with the highest 5 values (rather than the highest 5 cells), then amending the formula to:


 =SUMIF(B14:I14,">"&LARGE(B14:I14,6))


will do that - essentially summing the values of everything greater than the 6th highest value.


Note that the same consideration is in play with your solution where you are specifically adding 5 cell values, not accounting for multiples. Without knowing the OPs expectation on what to do with multiple equivalent values it's impossible to answer for sure.

Aug 17, 2024 9:33 AM in response to Badunit

Here is a general way to sum a specified number of cells (5 in this case) without having to add them up separately:


=SUMIF(B,">="&LARGE(B,5))−LARGE(B,5)×(COUNTIF(B,">="&LARGE(B,5))−5)


The duplicates will all be equal to the 5th largest. Count how many cells actually got added and subtract the value of the extra ones.

Aug 15, 2024 11:23 AM in response to Pugge

The other answers get close, but the simplest method is using =SUMIF()


=SUMIF(B14:I14,">="&LARGE(B14:I14,5))


The LARGE() function searches the 5th highest value in the range B14:I14


The SUMIF() function then sums all the values in the range that are greater than or equal to the result of the LARGE() function.


Care may be needed if there are multiple values - if there are multiple cells with the same 5th-highest value, then they will all be summed, but it isn't clear what your use case or design expectations are in this case.

Aug 17, 2024 9:18 AM in response to Camelot

I based my answer on the formula provided by the OP which was designed to sum five values.


=SUMIF(B14:I14,">"&LARGE(B14:I14,6)) may not sum the 5 highest values. In my example set, the 5th largest is the same as the 6th largest so the formula sums only the top 4. Your original formula correctly sums the top 5 plus any duplicates equal to the 5th.

Facing "Number Outside Valid Range" error in Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.