Automatically change cell references by more than 1 when dragging a formula

panza123

New Member
Joined
Mar 29, 2021
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
I want to create a number of columns with the difference of two other columns:

1. First column: B2-A2.
2. Second column: D2-C2.
3. Third column: F2-E2.
4. Fourth column: H2-G2.

...


How can I create the first column and just drag it across the other columns so that the values are calculated as above?
 

Excel Facts

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

diddi

Well-known Member
Joined
May 20, 2004
Messages
3,337
Office Version
  1. 2010
Platform
  1. Windows
copy paste the column in every second column, or fill right and delete every second column contents. if it is massive then fill right and use a macro the clear the columns not wanted
 

panza123

New Member
Joined
Mar 29, 2021
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Thanks. I know how to get it to work but, partly to use this as an opportunity to learn how to use certain functions, I wanted to use code which would not require deleting any columns (ie, I wanted code that I could drag across columns).
 

diddi

Well-known Member
Joined
May 20, 2004
Messages
3,337
Office Version
  1. 2010
Platform
  1. Windows
i dont think you can... macro would do it
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
63,649
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDEFGHIJKL
1
212356910141234
Main
Cell Formulas
RangeFormula
I2:L2I2=INDEX($A2:$H2,COLUMNS($I2:I2)*2)-INDEX($A2:$H2,COLUMNS($I2:I2)*2-1)
 

Forum statistics

Threads
1,143,687
Messages
5,720,295
Members
422,275
Latest member
Maria95

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