AZNPNOY2000
AZNPNOY2000

Reputation: 31

Google Spreadsheet: Summing up a range by using numeric value in another cell

I'm an AP Biology student and am trying to create a mathematical model for a Hardy-Weinberg lab using Google Spreadsheet. Here is the link to the spreadsheet. The problem is located on the "Gene Flow" tab on N111.

So I am trying to add all the number values above N until it hits a certain number. That quantity of organisms is dependent on the total number of organisms AFTER the migration of Generation 1. And that migration is just random chance of whether some will leave or arrive. By adding up the new generation, I need to calculate the genotypes of their offspring (a.k.a. Generation 2), assuming there is 1:1 ratio between each generation.

Here is the code I tried:

=SUM(N6:N(SUM(F107:H107)+6))

However, the error I receive is Argument must be an range.

Is there a way to properly express this through Google Spreadsheet?

Upvotes: 0

Views: 57

Answers (1)

Florian Minges
Florian Minges

Reputation: 606

You could use the INDIRECT function. It returns a cell/range reference with only a string as input. For example:

=SUM(INDIRECT("N6:N"&(SUM(F107:H107)+6)))

Upvotes: 1

Related Questions