broncosrul
New Member
- Joined
- May 3, 2012
- Messages
- 25
I am trying to sum a couple ranges based on labels in another row. The reason that I need it to be based on these labels is that the range will change. I have managed to get cell addresses in a very clunky way, but I can't get them to sum. Plus, it seems like there is probably a better way to identify the range. (just now thinking that I may be able to do this with SUMIF). But anyway, here is where I am at.
Row 1 is text and cannot be formatted differently. I was able to get some of the addresses with these formulas. Cell B2 would always be consistant. Basically, I need to sum the 2016 range and the 2017 range.
delivered E2
delivered G2
But I don't know how to sum those delivered addresses.
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Wk
[/TD]
[TD]W/E 07/02/2016
[/TD]
[TD]W/E 07/09/2016
[/TD]
[TD]W/E 07/16/2016
[/TD]
[TD]W/E 07/01/2017
[/TD]
[TD]W/E 07/08/2017
[/TD]
[TD]W/E 07/15/2017
[/TD]
[TD]YOY $ Chg
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Sales
[/TD]
[TD]$500
[/TD]
[TD]$800
[/TD]
[TD]$300
[/TD]
[TD]$750
[/TD]
[TD]$500
[/TD]
[TD]$900
[/TD]
[TD]need formula for this cell that would deliver =(sum(E2:G2)-sum
(B2:D2))
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Row 1 is text and cannot be formatted differently. I was able to get some of the addresses with these formulas. Cell B2 would always be consistant. Basically, I need to sum the 2016 range and the 2017 range.
Code:
=ADDRESS(2,MATCH(TRUE,INDEX(RIGHT(A4:I4,2)="2017",0),0),4,1)
Code:
=ADDRESS(2,MATCH(TRUE,INDEX(A1:R1="",0),0)-2,4,1)
But I don't know how to sum those delivered addresses.
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Wk
[/TD]
[TD]W/E 07/02/2016
[/TD]
[TD]W/E 07/09/2016
[/TD]
[TD]W/E 07/16/2016
[/TD]
[TD]W/E 07/01/2017
[/TD]
[TD]W/E 07/08/2017
[/TD]
[TD]W/E 07/15/2017
[/TD]
[TD]YOY $ Chg
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Sales
[/TD]
[TD]$500
[/TD]
[TD]$800
[/TD]
[TD]$300
[/TD]
[TD]$750
[/TD]
[TD]$500
[/TD]
[TD]$900
[/TD]
[TD]need formula for this cell that would deliver =(sum(E2:G2)-sum
(B2:D2))
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]