How to sum data in a column given adjacent column data

griff384

New Member
Joined
Jun 23, 2014
Messages
3
I want to sum values in column K given a range of dates from column B. Using the Sum, indirect, offset and match functions.
B C D E F G H I J K
[TABLE="width: 685"]
<colgroup><col><col><col span="2"><col><col span="3"><col><col></colgroup><tbody>[TR]
[TD]7/15/2006 [/TD]
[TD]135.8[/TD]
[TD]0.002[/TD]
[TD]1.209[/TD]
[TD]0.016[/TD]
[TD]1.4[/TD]
[TD]1.3[/TD]
[TD]26.55[/TD]
[TD]9.2[/TD]
[TD]-7.9[/TD]
[/TR]
[TR]
[TD]7/16/2006[/TD]
[TD]147.1[/TD]
[TD]0.080[/TD]
[TD]1.136[/TD]
[TD]0.014[/TD]
[TD]2.3[/TD]
[TD]2.1[/TD]
[TD]37.19[/TD]
[TD]9.9[/TD]
[TD]106.4[/TD]
[/TR]
[TR]
[TD]7/17/2006[/TD]
[TD]143.8[/TD]
[TD]-0.023[/TD]
[TD]1.202[/TD]
[TD]0.011[/TD]
[TD]2.2[/TD]
[TD]2.1[/TD]
[TD]33.87[/TD]
[TD]9.9[/TD]
[TD]-33.3[/TD]
[/TR]
[TR]
[TD]7/18/2006[/TD]
[TD]138.2[/TD]
[TD]-0.040[/TD]
[TD]0.955[/TD]
[TD]0.008[/TD]
[TD]2.7[/TD]
[TD]2.6[/TD]
[TD]28.18[/TD]
[TD]10.0[/TD]
[TD]-56.9[/TD]
[/TR]
[TR]
[TD]7/19/2006[/TD]
[TD]154.2[/TD]
[TD]0.110[/TD]
[TD]1.256[/TD]
[TD]0.005[/TD]
[TD]3.7[/TD]
[TD]3.6[/TD]
[TD]44.23[/TD]
[TD]10.0[/TD]
[TD]160.5[/TD]
[/TR]
[TR]
[TD]7/20/2006[/TD]
[TD]134.2[/TD]
[TD]-0.139[/TD]
[TD]1.911[/TD]
[TD]0.003[/TD]
[TD]2.0[/TD]
[TD]1.9[/TD]
[TD]24.28[/TD]
[TD]9.8[/TD]
[TD]-199.5[/TD]
[/TR]
</tbody>[/TABLE]

So I have a date range, in this case 7/15/2006 and ending at 7/20/2006 and I want to use those parameters to reference and sum the corresponding values in column K as shown. This part of the spreadsheet begins at row 51 and ends at row 56. The formula needs to be variable, I've tried doing it as such... =SUM(INDIRECT("K"&MATCH(C37,'Ch 5 & 6'!B1:B56,0)&":K"&MATCH(C38,'Ch 5 & 6'!B1:B56,0)))

But it's giving me a value of 0 and the practice worksheet tells me I need to embed Match within indirect within offset within sum. Any help would be greatly appreciated. Thank you!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
When I copy your table and formula, I get -30.7, not 0. Is your worksheet calculation set to automatic or manual?
 
Upvote 0
I want to sum values in column K given a range of dates from column B. Using the Sum, indirect, offset and match functions.
B C D E F G H I J K
[TABLE="width: 685"]
<tbody>[TR]
[TD]7/15/2006[/TD]
[TD]135.8[/TD]
[TD]0.002[/TD]
[TD]1.209[/TD]
[TD]0.016[/TD]
[TD]1.4[/TD]
[TD]1.3[/TD]
[TD]26.55[/TD]
[TD]9.2[/TD]
[TD]-7.9[/TD]
[/TR]
[TR]
[TD]7/16/2006[/TD]
[TD]147.1[/TD]
[TD]0.080[/TD]
[TD]1.136[/TD]
[TD]0.014[/TD]
[TD]2.3[/TD]
[TD]2.1[/TD]
[TD]37.19[/TD]
[TD]9.9[/TD]
[TD]106.4[/TD]
[/TR]
[TR]
[TD]7/17/2006[/TD]
[TD]143.8[/TD]
[TD]-0.023[/TD]
[TD]1.202[/TD]
[TD]0.011[/TD]
[TD]2.2[/TD]
[TD]2.1[/TD]
[TD]33.87[/TD]
[TD]9.9[/TD]
[TD]-33.3[/TD]
[/TR]
[TR]
[TD]7/18/2006[/TD]
[TD]138.2[/TD]
[TD]-0.040[/TD]
[TD]0.955[/TD]
[TD]0.008[/TD]
[TD]2.7[/TD]
[TD]2.6[/TD]
[TD]28.18[/TD]
[TD]10.0[/TD]
[TD]-56.9[/TD]
[/TR]
[TR]
[TD]7/19/2006[/TD]
[TD]154.2[/TD]
[TD]0.110[/TD]
[TD]1.256[/TD]
[TD]0.005[/TD]
[TD]3.7[/TD]
[TD]3.6[/TD]
[TD]44.23[/TD]
[TD]10.0[/TD]
[TD]160.5[/TD]
[/TR]
[TR]
[TD]7/20/2006[/TD]
[TD]134.2[/TD]
[TD]-0.139[/TD]
[TD]1.911[/TD]
[TD]0.003[/TD]
[TD]2.0[/TD]
[TD]1.9[/TD]
[TD]24.28[/TD]
[TD]9.8[/TD]
[TD]-199.5[/TD]
[/TR]
</tbody>[/TABLE]

So I have a date range, in this case 7/15/2006 and ending at 7/20/2006 and I want to use those parameters to reference and sum the corresponding values in column K as shown. This part of the spreadsheet begins at row 51 and ends at row 56. The formula needs to be variable, I've tried doing it as such... =SUM(INDIRECT("K"&MATCH(C37,'Ch 5 & 6'!B1:B56,0)&":K"&MATCH(C38,'Ch 5 & 6'!B1:B56,0)))

But it's giving me a value of 0 and the practice worksheet tells me I need to embed Match within indirect within offset within sum. Any help would be greatly appreciated. Thank you!

What about the SUMIFS:
=SUMIFS(K:K,'Ch 5 & 6'!B:B,">="&C37,'Ch 5 & 6'!B:B,"<="&C38)
 
Upvote 0
When I copy your table and formula, I get -30.7, not 0. Is your worksheet calculation set to automatic or manual?

It is set to automatic. I'm trying to refresh it and i'm still getting 0, but -30.7 is the value I should be getting. I've also tried the sumifs, still getting 0, I have a weird student version of excel, but it should behave the same as the 2007 version.
 
Last edited:
Upvote 0
<html><head><title>Excel Jeanie HTML</title></head><body>


<!-- ######### Start Erzeugter Html Code zum Kopieren ########## -->


Excel Workbook
ABCDEFGHIJ
115-06-2006135.80.0021.2090.0161.41.326.559.2-7,9
216-06-2006147.10.0801.1360.0142.32.137.199.9106,4
317-06-2006143.8-0.0231.2020.0112.22.133.879.933,3
418-06-2006138.2-0.0400.9550.0082.72.628.1810.056,9
519-06-2006154.20.1101.2560.0053.73.644.2310.0160,5
620-06-2006134.2-0.1391.9110.0032.01.924.289.8199,5
7
8
9
10
1115-06-200615-06-2006
12
13-7,9
Sheet5







<!-- ######### Ende Erzeugter Html Code zum Kopieren ########## -->


</body></html>
 
Upvote 0
Thank you Caribeiro that seems to have made it work though I'm not sure why the other solutions did not. A solution using Indirect, Offset and Match is also welcome. However I have seemed to solve me issue at the moment. Thank You all!
 
Upvote 0

Forum statistics

Threads
1,223,646
Messages
6,173,536
Members
452,520
Latest member
Pingaware

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