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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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
 
Upvote 0
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).
 
Upvote 0
i dont think you can... macro would do it
 
Upvote 0
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)
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

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
Back
Top