ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing Cell location within a formula (https://www.excelbanter.com/excel-programming/305305-changing-cell-location-within-formula.html)

woknick[_2_]

Changing Cell location within a formula
 
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

--
Message posted from http://www.ExcelForum.com


JulieD

Changing Cell location within a formula
 
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

"woknick " wrote in message
...
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 advance


---
Message posted from http://www.ExcelForum.com/




Tom Ogilvy

Changing Cell location within a formula
 
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)

--
Regards,
Tom Ogilvy



"woknick " wrote in message
...
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 advance


---
Message posted from http://www.ExcelForum.com/




woknick[_3_]

Changing Cell location within a formula
 
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

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com