Changing Cell location within a formula

  • Thread starter Thread starter woknick
  • Start date Start date
W

woknick

How can change the cell locations within a formula. Here is my formula

=SQRT((B8-B7)^2+(C8-C7)^2)

I want to be able to substitute user inputs for the B7,B8,C7, and C8.

Please let me know how to change those locations to variables.

thanks in advanc
 
Hi

set up an area of the worksheet to be where your users input the cell
references they want to use
i've chosen A11:A14
then change the formula as follows

=SQRT((INDIRECT(A11)-INDIRECT(A12))^2+(INDIRECT(A13)-INDIRECT(A14))^2)

Regards
JulieD
 
assume the user will enter the cell addresses in A1 to A4. For example, to
use your existing addresses:

A1: B8
A2: B7
A3: C8
A4: C7

then your formula would be

=SQRT((INDIRECT(A1)-INDIRECT(A2))^2+(INDIRECT(A3)-INDIRECT(A4))^2)
 
That seems like that will work, lets say I have 2 colums of numbers:

X and Y
2 6
3 8
3 5
5 4

reference 9 and 4

and I want excel to use a fixed user input for the B7 and C7 and hav
the program step through the displayed X and Y numbers

example:

=SQRT((2-9)^2+(6-4)^2)
=SQRT((3-9)^2+(8-4)^2)
and so on.
I need excell to step through each number.

Thanks in advanc
 

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

Back
Top