Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying range from A2 till infinity (NO VBA)

Without VBA, I am trying to refer a range that starts at A2 and never ends. For example, if I want row 2 till row 5 i'd do

$A$2:$A$5

But what if I want the end to be open?

$A$2:??

Is this possible?

like image 556
GeneCode Avatar asked Oct 06 '17 08:10

GeneCode


4 Answers

Another option (in case your formula is in A1, so accessing A:A would create a circular reference) is:

OFFSET(A2, 0, 0, ROWS(A:A)-1)

This uses ROWS to count the total number of rows (without actually accessing the rows!), subtracts 1 (because we're starting with the second row), and uses this result as the height of a range created with OFFSET.

like image 82
Ovaflo Avatar answered Sep 28 '22 01:09

Ovaflo


A2:A works in many formulas hope that helps

like image 34
Jefferey Avatar answered Sep 28 '22 03:09

Jefferey


Depending on what's in A1 and what formula you're putting the reference into, you could simply use A:A. For example, if you wanted to sum all of the values in column A, but A1 contained a column title rather than a number, you could still write =SUM(A:A) and the title in A1 would just be ignored.

like image 30
Dani Avatar answered Sep 28 '22 01:09

Dani


If you want to refer to a range starting from A2 until max row (1048576 or 65536 for Excel prior to 2007), you can use this volatile formula... =OFFSET(A2,0,0,(COUNTBLANK(A:A)+COUNTA(A:A)-1),1) . Use formula as a defined range name or inside other formula which takes range as an argument (for eq SUM)...

like image 28
Kresimir L. Avatar answered Sep 28 '22 03:09

Kresimir L.