4 Replies Latest reply on Nov 1, 2014 1:29 PM by gkaiseril

# sum a group of numbers

I have a group of 90 cells within a form labeled "B1" to "B90". I need to sum the highest cell number with a value in it and the previous 3.

for example: B20+B21+B22+B23

some of the preceding cells may be blank or equal to "0"

What is the best way to salve this?

• ###### 1. Re: sum a group of numbers

I would save all the values in an array, then iterate it to find the

highest value, then gather the values of the fields before it.

But you also need to think what should happen if that field doesn't have 3

fields before it (for example, if it's the second field)...

On Fri, Oct 24, 2014 at 10:30 PM, James A Hiltz CET <

• ###### 2. Re: sum a group of numbers

Yes, I did think of an array but my concern is though the fields may increase in value the values in the fields may not.

• ###### 4. Re: sum a group of numbers

Have you thought of an approach to this issue?

How do you know or determine the last field filled in?

How do you want to handle fields below the last filled in field that are filled in?

How do you want to handle the case were the last field in field cannot have 2 more field below it?

Hint or field 1 or field 1 and 2 are filled in.