Sum a slice of a named range?

LostInDaJungle

New Member
Joined
Feb 27, 2012
Messages
47
So, I have a table that has the monthly sales in one column and the sales budgets in another column. Since monthly sales is a running total, it's easy to calculate current YTD. Sales Budgets is another thing entirely. We have Sales Budgets pre-written through December.

What I need is to be able to sum an array slice. SUM(myArray[1-5]) That way I could have the YTD budgets for the current month. How can I sum the first n members of a named range?

Budgets are in a named array called 'SalesBudgets_2012'

A single month's budget is retrievable with:
Code:
=INDEX(INDIRECT("SalesBudgets_" & DashYear),DashMonth)

DashYear is 2012, DashMonth is 5. Both of these are fed from a Drop Down list.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try the offset function

Offset(array,#rows,#cols,Height,Width)

If this returns the 1st cell you want in the sum
=INDEX(INDIRECT("SalesBudgets_" & DashYear),DashMonth)

Then this will sum a 5 cell verticle range beginning with that cell.
=SUM(OFFSET(INDEX(INDIRECT("SalesBudgets_" & DashYear),DashMonth),0,0,5,1))
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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