trying to use output of ADDRESS function as a reference

This is one of those “there must be a way to do this” things.

Perhaps I misunderstand the point of the ADDRESS function, but it seems as though its output should be useable as a cell reference, one way or another. Instead it returns a string that cannot be plonked into another formula and treated as a reference, or not the way I’m doing it anyway. Rats!

So, for instance, let’s say I want to
sum(A10:A15)

For my own mysterious reasons, I would rather say
*sum( address(10,4) : a15 )*

Doesn’t work. Produces the error ‘address(10,4):a15 isn’t a valid reference”.

Anyone know how to fix this? How to make SUM use the output of ADDRESS?

That’s the basic question, but for context, the reason I want to reference a cell with address is because I want to include MATCH in the ADDRESS function, because I don’t actually know what row I want. So I want to get the address like so:
address(match(b12-1,b)+1,4)

Which works marvelously insofar as it returns the address of the cell where I want to start summing. But it returns it as a string, apparently.

Posted on Jan 5, 2009 2:41 PM

Reply
8 replies

Jan 5, 2009 7:11 PM in response to Paul Ingraham

Paul,

I think you have two problems with your preference for the first instance.

1. ADDRESS(row, column, [type], [style], [table]) constructs a cell address string, but to use it in an expression you need to combine it with INDIRECT(address, [style]).

2. Your ADDRESS(10,4):A15 is a backwards way to express a range (even with the required INDIRECT function), and had you typed the address directly, Numbers would have straightened it out for you. You may be aggravating the Compiler with your syntax for the range.

To sum the range A10:A15 using your method would require: =SUM(INDIRECT(ADDRESS(10,1)):A15).

Regards,

Jerry

Jan 5, 2009 8:07 PM in response to Jerrold Green1

Thanks, Jerry! INDIRECT was the function I needed. I got my formula functioning perfectly within moments of reading that.

The backwards range you pointed out arose from carelessly inserting “A15” as an example. I didn’t think it through. Since ADDRESS(10,4) refers to the 10th row and the 4th column (D), a range with that starting point obviously cannot finish at A15. 😉 However, conceptually I was not focussed on the actual details of the range, and simply on how to get the output of ADDRESS to “compute” when used in summing a range.

Thanks again.

Jan 6, 2009 2:16 AM in response to Paul Ingraham

To get a range, it would be useful to study the function OFFSET()

User uploaded file

Here, in E3, the formula is:
=SUM(OFFSET($A$1,1,1,5,2))
which means:
starting from the cell whose
horizontal offset from $A$1 is 1
vertical offset from $A$1 is 1
sum the range whose
height is 5 rows
width is 2 columns

It's equivalent to
=sum(B2:C6)

Yvan KOENIG (from FRANCE mardi 6 janvier 2009 11:15:51)

Jan 6, 2009 10:27 AM in response to KOENIG Yvan

Interesting function, although I cannot, for lack of imagination, see a practical application for it. Can you give a usage example? Why not just say B2:c6?

My own question in this thread was generally inspired by a need to produce an unknown and variable range. If I know that some values are going to be in the “neighbourhood” of a reference point, offset wouldn’t quite help, because I wouldn’t know exactly where the values were relative to the reference point. I needed to find the distance (in rows) from the reference point, so I had to use MATCH.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

trying to use output of ADDRESS function as a reference

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