How to get cell coordinates?

L

lukus2005

As previously posted, I am trying to build a formula that updates its
cell references automatically based on what line the formula is
entered.

My formula will be more complex but for the sake of simplicity, here's
an example of what I'm trying to achieve...

A1 = 100
A2 = 25
A3 = C3
B1 = 50
B2 = 10
B3 = C3

C3 = formula that adds A1+A2 or B1+B2, depending on the row number.
Please remember that this is a simple example and that my actual
formula will be more complex and therefore, an IF statement will be
too long for what I want to achieve.

In other words, my formula has to be generic so that several cells may
refer to it and it will update the cell references within the formula
based on the referring cell's row #. ie: C3 = (referring cell's row
#)1 + (referring cell's row #)2 so that A3 = 125 and B3 = 60
 
B

Bernard Liengme

Not very clear, to me at least
Possible answer: In A3 use =A1+A2 and copy the formula to B3 (by
dragging)where it automatically becomes =B1+B2

But I must have reread the question. What do you mean by A3=C3? do you mean
A3 has the same values as C3? If so, what row are you talking about?

best wishes
 
L

lukus2005

Not very clear, to me at least
Possible answer: In A3 use =A1+A2 and copy the formula to B3 (by
dragging)where it automatically becomes =B1+B2

But I must have reread the question. What do you mean by A3=C3? do you mean
A3 has the same values as C3? If so, what row are you talking about?

best wishes
In my attempt to simplify what I need to achieve, I have made the
solution look too easy.

The whole thing will be way more complex than a simple A+B formula. So
what I am trying to achieve is for several cells to use the same
formula stored in a cell somewhere on the sheet.

So say E20 contains a formula like... (((A?*2)+(B?*2))+2)/144... where
the ? need to automatically change to the row # of the referring
cell. In other words, if Column A = Width, B = Height, C = Total <<<
Calculated using the formula found in E20.

C1, C2, C3, C4, etc... all look at E20 for their answer. E20 must
take into consideration which cell is asking for the total... if C3,
then it must change the ? to 3 so that the formula now looks like
(((A3*2)+(B3*2))+2)/144.
 
B

Bernard Liengme

E20 can have but one formula, so C1, C2 etc cannot change what is in E20

If we miss out E20 from the discussion, then in C1 enter
=(((INDIRECT("A"&ROW())*2)+(INDIRECT("B"&ROW())*2))+2)/144
Since this is in a cell in row 1, it is equivalent to
(((A1*2)+(B1*2))+2)/144
When copied from C1 to C2 it is equivalent to (((A2*2)+(B2*2))+2)/144

Is this closer to your need?
Remove TRUENORTH to communicate directly
best wishes
 

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