use address function to indicate range in calculation

M

Mayo

I want to use the address function to indicate the range in the
calculation of a slope:

cell A2 contains the value 20

=ADDRESS(A2,2) returns $B$20
=ADDRESS(A2,3) returns $C$20

Cell B20 and C20 are the starting cells for calculating the slope:
=slope(B20:B25,C20:C25)

But putting the address function in the slope calculation, like
=slope(ADDRESS(A2,2):B25,ADDRESS(A2,3):C25) does not work!

Why can't I combine these functions?
Is there another (simple) way?


Mayo :(
 
M

Mayo

Thanx to my boyfriend I found the solution myself :rolleyes:

The indirect function should be used, it converts text to a cell or
range reference

My example would become:
=slope(indirect("B" & A2 & ":B25"),indirect("C" & A2 & ":C25"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top