Drag formula but skip reference cells!

mjleblanc

New Member
Joined
Oct 30, 2014
Messages
2
I'm making a budget and i am trying to have a page with expenses for every month and then on a seperate page i want to have the total of each category of expenses (i.e. gas, loans, entertainment, etc.) in the expenses worksheet i have three columns for each month: 1st column: date of purchase, 2nd column: category, 3rd column: price.
I am using a sumif function on the totals worksheet to sum the prices of each category, so for instance the function for gas is (=sumif('monthlyexpenses!'B:B,"gas",C:C)
Now I want to be able to just drag across to auto fill the next columns in the expenses sheet so that august will have a function of (=sumif('monthlyexpenses!'E:E,"gas",F:F)
and i want to keep this increment for reference cells so that when i drag to september it will be H:H and I:I.
However everytime i drag across it just moves one reference column over.
In essence i want the formula to skip two reference columns each time i drag to the next column
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I think this should do the trick
=SUMIF(OFFSET($B:$B,0,(COLUMNS($B$1:B1)-1)*2),"gas",OFFSET($C:$C,0,(COLUMNS($B$1:B1)-1)*2))
 
Upvote 0
thanks a ton! i was having so much trouble with this and i didnt want to use a pivot table because i dont like the layout
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,492
Members
448,967
Latest member
visheshkotha

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