Adding a formula to a column and make it auto-repetitive and deactivate the column

Copper Contributor

Hi Guys,

I want to add a formula to the column to the first cell, and then to be repeated for each new row, knowing that I want to disable this column because it is calculated and I do not want the user to change it. In addition, I still want the end-user to change other columns. 

14 Replies
If you want to lock the column reference you just need to put dollar sign before the column $
=FORMULA($A2)
If you want to lock the Row reference you just need to put dollar sign before the row $
=FORMULA(A$2)
If you want lock both just put dollar sign on both
=FORMULA($A$2)
But I will have to drag it myself, it will not repeat itself and I do not how many records we might have...
If you set that section us as a table then the formula will fill the entire column and as new rows of the table are added it will add the formula accordingly.
Alternatively, using dynamic arrays you can set up the formula to process on all the data. so in B1 you can use =A:A to copy all data in column A to column B. Of course the formula can get much more complicated and instead of referring to the entire column A:A you can refer to only the range that has data using something like OFFSET(A1,0,0,COUNTA(A:A)) and that could be used in a LET() statement in the cell or defined as a Name for the worksheet.

@hjameelq 

Find a gif with some ideas using the "fill handle" feature.

 

Autofill.gif

I need to add a formula to a column and make it disabled, not a data validation. A formula on the column and I want it to calculate the values in disable mode as I do not want users to change or enter anything there.
I understand except I don't think you mean or at least I don't understand what you mean by 'disabled'. I'm assuming you mean locked so the used can't edit that cell/column.
To do that you should highlight the cells/columns that the user is allowed to edit, right click and go to format cells, and under protect uncheck 'Locked' so those cells are NOT locked and then under the Review tab select Protect Sheet and you can select from various option and choose to give a password or not. This will prevent the user from editing that column or any other columns that you left 'Locked'.
As for automatically expanding the formula into additional cells I addressed above.
I recommend the 1st option with making a table. Highlight the area with the data and go to the home tab and select 'Format as Table' under 'Styles'. The make sure the range is correct if the first row is headers or not. Then when it is formatted as a table, when the user starts a new row, Excel will automatically expand the table and copy any formula accordingly.

@hjameelq 

This formula will multiply column B with Column C for each row. Calculated with ROWS:

 

=INDEX(B2:C11;SEQUENCE(ROWS(B2:B11)),1)*INDEX(B2:C11;SEQUENCE(ROWS(B2:B11)),2)

  Lock and password protect column A

 

 

@hjameelq 

 

So this calculated column, does the user have any use for it? or its just for your own use?

@mtarler I am making a checkbook that need to continue the balance forward.  Is there a clear instruction for making a column a table?  I am so tense right now because I am afraid of making a mess of things.  Right now I have to manually add the formula and it is exhausting.  

thanks for your help

Hi Pegi C, First off you probably should start a new thread with this question (unless my answer is all you need).
As for you question, when you do post in a new post please try to include more information about exactly what you want or need and hopefully attach an example (no confidential/personal info) or give a link to a shared workbook in sharepoint or onedrive or using something like dropbox.
You asked about "making a column a table" and above I noted how to make a table:
"Highlight the area with the data and go to the home tab and select 'Format as Table' under 'Styles'. Then make sure the range is correct and check if the first row is header row or not. "
As for making a running total you if we assume the AMOUNT is in A2 and then you want the RUNNING TOTAL in column B then in B2 you type =SUM(B1,A2)
When formatted as a table that column will autopopulate and fill down as you add new rows.

@mtarler :  Sorry this took me so long to get back to.  I don't know how to look for what I previously asked.

I am working with a checkbook type of situation.  I am not sure what "deactivate the column" means.   This is what I need.

The formula for the balance of checkbook at the current moment has to be added after each transaction.  This is a time waster and I know that there are solutions for this.  I need it to automatically add or subtract to or from the last balance and show the new balance.  I just want the formula to repeat.  My problem is that when I add a new transaction, the previous balance must be addressed in the formula and then the current row + or - from that to get new balance.  I hope that I've made myself clearer than the first time I requested help.

   This is the formula I use, "H" is the balance column [ F is the expense, G is the income]

=H-F(current row)+G(current row)

 

I hope this is understandable.  Thanks again for your assistance.

   

no problem, I know how life gets in the way.
that said, I reiterate this should be added as a new question/post
please try formatting the data as a table (Home -> Format as Table)
If you are still having issues, please create a new thread/question and attach a sample file so we can give more specific step-by-step instructions and update the file accordingly as an example.