How to keep Formulas in excel from moving with columns when inserting.

BenGrobler

New Member
Joined
Apr 19, 2021
Messages
25
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
I have a formula that starts in Column"O" , each time i process data that is captured in Column "O" then a new column is inserted for the next data.
My Formula is =COUNTIF(O4:XFD4,"Cool") after inserting the new column my formula is =COUNTIF(P4:XFD4,"Cool")

i need it to stay the same after inserting a new column?
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,374
Office Version
  1. 365
Platform
  1. Windows
have no idea what an anhor column is i am very new to this, please explain how to do this? please please
I already explained this back in post 7. It is pretty simple. Just insert a blank column, hide it, and update your code to start insert new columns AFTER that column, but make sure that your formulas reference this hidden column as your starting column. Then inserting new columns after that will not change the starting column in your formulas.
 
Solution

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

BenGrobler

New Member
Joined
Apr 19, 2021
Messages
25
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
I already explained this back in post 7. It is pretty simple. Just insert a blank column, hide it, and update your code to start insert new columns AFTER that column, but make sure that your formulas reference this hidden column as your starting column. Then inserting new columns after that will not change the starting column in your formulas.
thank you i got it it works perfectly thanks
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,374
Office Version
  1. 365
Platform
  1. Windows
You are welcome.
 

Forum statistics

Threads
1,136,954
Messages
5,678,754
Members
419,782
Latest member
gc75150

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top