ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How can I script formula? (https://www.excelbanter.com/excel-worksheet-functions/98262-how-can-i-script-formula.html)

Sam

How can I script formula?
 
Here is what I am trying to do
Cell B=A*2+18+3 Then C=B*2 without pointing to specific cells such as A1, A2
ect.

I'm hoping i can automate it so it uses whatever row it is on for the
equation instead of requiring me to point to specific Cells for the
calculation to work.
Any help or advice is greatly appreciated thanks.

Roger Govier

How can I script formula?
 
Hi Sam

Not too sure what you mean here.
If in cell B1 you enter
=A1*2+18+3
Then as you copy it down the column it would change automatically to
=A2*2+18+3, =A3*2+18+3 etc.
If you copy across it will change to
=B1*2+18+3 = C1*2+18+3

This is because the references are all relative.
You can make the Column an Absolute reference by putting a $ sign in
front of it
=$A1*2+18+3 where the column won't change as you copy across, but the
row would change as you copy down.
Conversely you can make the Row reference Absolute by prefixing with a $
sign
=A$1*2+18+3 where the column will alter as you copy across but the row
will be fixed.

Finally, prefixing both column and row with $ sign fixes the cell to be
absolute and it won't change at all as you copy down or across
=$A$1*2+18+3

Is this what you meant? If not post back with more detail of what you
want.

--
Regards

Roger Govier


"Sam" wrote in message
...
Here is what I am trying to do
Cell B=A*2+18+3 Then C=B*2 without pointing to specific cells such as
A1, A2
ect.

I'm hoping i can automate it so it uses whatever row it is on for the
equation instead of requiring me to point to specific Cells for the
calculation to work.
Any help or advice is greatly appreciated thanks.




Sam

How can I script formula?
 
I actually figured it out a few minutes after I posted the question.
What I was looking for was the Highlight columns and Control enter so that
it would automate the calculation for every row I highlight without having to
point to A1, A2, A3 ect for each new row.
I appreciate the help and have a wonderful day.

"Roger Govier" wrote:

Hi Sam

Not too sure what you mean here.
If in cell B1 you enter
=A1*2+18+3
Then as you copy it down the column it would change automatically to
=A2*2+18+3, =A3*2+18+3 etc.
If you copy across it will change to
=B1*2+18+3 = C1*2+18+3

This is because the references are all relative.
You can make the Column an Absolute reference by putting a $ sign in
front of it
=$A1*2+18+3 where the column won't change as you copy across, but the
row would change as you copy down.
Conversely you can make the Row reference Absolute by prefixing with a $
sign
=A$1*2+18+3 where the column will alter as you copy across but the row
will be fixed.

Finally, prefixing both column and row with $ sign fixes the cell to be
absolute and it won't change at all as you copy down or across
=$A$1*2+18+3

Is this what you meant? If not post back with more detail of what you
want.

--
Regards

Roger Govier


"Sam" wrote in message
...
Here is what I am trying to do
Cell B=A*2+18+3 Then C=B*2 without pointing to specific cells such as
A1, A2
ect.

I'm hoping i can automate it so it uses whatever row it is on for the
equation instead of requiring me to point to specific Cells for the
calculation to work.
Any help or advice is greatly appreciated thanks.






All times are GMT +1. The time now is 08:22 PM.

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