Add formula to every other cell until data runs out

sangsterexcell

New Member
Joined
Dec 11, 2014
Messages
11
I need to add a formula to every other row to calculate values. Searching the internet for this hasn't helped me understand what I need to do. I have not used macros if a macro is what I need to do, but did find out how to edit/create one that I found in these forums but I was not able to make the changes successfully. If a macro is what I need can it be explained how it works and how to make it work.

I need in column "M" starting in Row 2 a calculation that shows "=H3-H2" and then putting that formula into every 2nd row making it rows 2,4,6,8,etc until my data runs out. The formula also needs to change accordingly "=H5-H4" and so on.

I then need to do the same thing in column N for G3-G2 and so on as above.

Excel version is 2007

Please let me know if you need more information.

Thanks for help in advance
 
Last edited:

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
what happens in the intervening rows?

One solution would be a formula that returns a blank on the odd rows:

=if(mod(row(),2)=0,H3-H2,"")
 
Last edited:
Upvote 0
Just put the formula in M2 and copy down.

Hope it helps.
 
Upvote 0
Hi & welcome to the board
Insert you formula into M2 then select both M2 & M3, put the cursor over the bottom right hand corner of the selection (the cursor should change to a + symbol).
Then simply click & drag down
 
Upvote 0
Just for clarity which solution worked best? (I hadn't thought of Fluff's approach)
 
Upvote 0
I copied your formula into M2 then dragged it down and also over into N.

I also did Fluff's suggestion in other cells to test it and it worked the same.
 
Last edited:
Upvote 0
Ideal, glad we could help and thanks for the feedback.

Regards
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,127
Members
452,381
Latest member
Nova88

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