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

Occasional 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. 

9 Replies
If you want to lock the column reference you just need to put dollar sign before the column $
If you want to lock the Row reference you just need to put dollar sign before the row $
If you want lock both just put dollar sign on both
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.


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



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.


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



  Lock and password protect column A





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