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
59,084
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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

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
59,084
Office Version
  1. 365
Platform
  1. Windows
You are welcome.
 

Forum statistics

Threads
1,141,772
Messages
5,708,447
Members
421,570
Latest member
BaileyJ

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