views:

464

answers:

3

Ok, so here's my problem... and I'll preface this by saying that I'm pretty well-versed in Excel; however, I've very little knowledge about the INDIRECT function (so if it's something obvious with the INDIRECT function, please excuse my newb-ness).

I'm trying to make my Compliance Worksheet a bit more efficient. I have a list of controls in sections (and sub-sections), and I use a value as a placeholder to count the number of controls per section (or sub-section), as well as exceptions per section. Basically, I use the value "1" if there is a valid control, and sum up these values per section or sub-section. Pretty straight-forward, right?

However, I very often have to add additional rows to the bottom of a section, and this throws my sum-formula off, requiring a lot of manual updating to these formulas. When I work on larger worksheets, this becomes a very burdensome task.

So, what I would LIKE to do is to utilize a forumal to either "sum-until" or "count-until" the next section. I've attached an example of what I'm speaking about to better give you a visual.

Is there a way to do this? Sum (or Count) until the next forumla or non-"1"-value? Would it just be easier to put an "end" value at the bottom of each of these sections, and count until "end"? This wouldn't be an ideal way to perform such a function (as there will be a good number of unnecessary "ends" between sections), but if there's not a better way, perhaps I'll explore that avenue.

Thanks in advance for any help you may be able to provide!!

Link to screenshot, since I can't post images yet...

+1  A: 

Use a Named Range for each section, then when you add the row, just add it to your named range.

So you could name a range 'Section1' to be C3:C9, then when you add a row, just right click on the row number 9, and 'Insert', then the new row will be in 'Section1'. So then you can just put the formula in as

=Sum(Section1)

Lance Roberts
+1 This is an excellent solution.
e.James
A: 

=sum(offset(c3;0;0;c2;1)

Jerry
A: 

Use a dynamic named range.

Excellent resource here: http://www.ozgrid.com/Excel/DynamicRanges.htm

Basically you reference the named range in your sum formula, but since the range is dynamic it adjusts automatically.

(Kind of a combination of Jerry and Lance's answers)

guitarthrower