ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Locking portions of a formula (https://www.excelbanter.com/excel-worksheet-functions/92212-locking-portions-formula.html)

tiggatattoo

Locking portions of a formula
 

Hi,
I am looking to find out how to lock a specific cell in a formula.

for example: when I copy and paste a formula, it automatically grabs
the next cell in line in the column.

In the same row I would like to keep two cells locked so it only
changes the column heading not the row.

I have about 100 or so columns to do this for and 4,000 rows.
How can I copy and paste or paste special or something to get this to
work without manually typing the formula for each cell. See example
below.

ex: column BM Row 2 formula =if(BM1=BK2,BL2,0)
column BM Row 3 formula =if(BM1=BK3,BL3,0)
column BM row 4 formula =if(BM1=BK4,BL4,0)
column BN Row 2 formula =if(BN1=BK2,BL2,0)
column BN Row 3 formula =if(BN1=BK3,BL3,0)
column BN Row 4 formula =if(BN1=BK4,BL4,0)
column BO Row 2 formula =if(BO1=BK2,BL2,0)
column BO Row 3 formula =if(BO1=BK3,BL3,0)
column BO Row 4 formula =if(BO1=BK4,BL4,0)


Thanks Candie


--
tiggatattoo
------------------------------------------------------------------------
tiggatattoo's Profile: http://www.excelforum.com/member.php...o&userid=35104
View this thread: http://www.excelforum.com/showthread...hreadid=548597


Miguel Zapico

Locking portions of a formula
 
You can lock the column that you need using the $ sign before it. For example:
column BM Row 2 formula =if(BM1=$BK2,$BL2,0)
When you copy this formula, the reference to the columns Bk and BL won't
change.

Hope this helps,
Miguel.

"tiggatattoo" wrote:


Hi,
I am looking to find out how to lock a specific cell in a formula.

for example: when I copy and paste a formula, it automatically grabs
the next cell in line in the column.

In the same row I would like to keep two cells locked so it only
changes the column heading not the row.

I have about 100 or so columns to do this for and 4,000 rows.
How can I copy and paste or paste special or something to get this to
work without manually typing the formula for each cell. See example
below.

ex: column BM Row 2 formula =if(BM1=BK2,BL2,0)
column BM Row 3 formula =if(BM1=BK3,BL3,0)
column BM row 4 formula =if(BM1=BK4,BL4,0)
column BN Row 2 formula =if(BN1=BK2,BL2,0)
column BN Row 3 formula =if(BN1=BK3,BL3,0)
column BN Row 4 formula =if(BN1=BK4,BL4,0)
column BO Row 2 formula =if(BO1=BK2,BL2,0)
column BO Row 3 formula =if(BO1=BK3,BL3,0)
column BO Row 4 formula =if(BO1=BK4,BL4,0)


Thanks Candie


--
tiggatattoo
------------------------------------------------------------------------
tiggatattoo's Profile: http://www.excelforum.com/member.php...o&userid=35104
View this thread: http://www.excelforum.com/showthread...hreadid=548597



David Biddulph

Locking portions of a formula
 
"tiggatattoo"
wrote in message
...

Hi,
I am looking to find out how to lock a specific cell in a formula.

for example: when I copy and paste a formula, it automatically grabs
the next cell in line in the column.

In the same row I would like to keep two cells locked so it only
changes the column heading not the row.

I have about 100 or so columns to do this for and 4,000 rows.
How can I copy and paste or paste special or something to get this to
work without manually typing the formula for each cell. See example
below.

ex: column BM Row 2 formula =if(BM1=BK2,BL2,0)
column BM Row 3 formula =if(BM1=BK3,BL3,0)
column BM row 4 formula =if(BM1=BK4,BL4,0)
column BN Row 2 formula =if(BN1=BK2,BL2,0)
column BN Row 3 formula =if(BN1=BK3,BL3,0)
column BN Row 4 formula =if(BN1=BK4,BL4,0)
column BO Row 2 formula =if(BO1=BK2,BL2,0)
column BO Row 3 formula =if(BO1=BK3,BL3,0)
column BO Row 4 formula =if(BO1=BK4,BL4,0)


Try
=if(BM$1=$BK2,$BL2,0)

I suggest you look at the help on absolute and relative addressing.
--
David Biddulph




All times are GMT +1. The time now is 10:19 AM.

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