Sum multiple rows with changing column

zJenkins

Board Regular
Joined
Jun 5, 2015
Messages
148
Hi,

I've seen variations of this question but haven't found anything that solves what I am trying to accomplish.

I have 2 worksheets, a Summary worksheet, and a Details worksheet. The summary worksheet summarizes what is on the detail worksheet (pretty crazy eh??).

The Details worksheet is as follows:

1234
AccountJanFebMarApr
61000100150125100
61000200200150175
61001250175125150
61001150150125125

<tbody>
</tbody>


The Summary worksheet is as follows:

Month3
AccountAmount
61000
(Calculated result - 175)
61001(Calculated result - 150)
etc.(Calculated result)

<tbody>
</tbody>


On the Summary worksheet, C1 (value = 3 in the example above), this value is able to be changed by the user, they can select which month they want to see the results for. It was originally to be used as a helper value for an Index/Match formula to return the value in the March (3) column, or whatever month was selected. The issue is that when an account has multiple lines in the Details worksheet, such as 61000 and 61001 in the above example, the Index/Match formula doesn't work because there are multiple values. I'm wondering if there is a way to incorporate the SUMIF function to get the desired result...

Any help would be greatly appreciated.

Thanks!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Perhaps:

ABC
1Month3
2AccountAmount
361000275
461001250
5etc.

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Summary

Worksheet Formulas
CellFormula
B3=SUMIF(Details!$A$3:$A$100,A3,INDEX(Details!$B$3:$Z$100,0,MATCH($C$1,Details!$B$1:$Z$1,0)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



You can subtract the 175 or 150 as needed.
 
Upvote 0
UnPivot source table via PowerQuery then use PivotTable with QueryTable with Month as filter

MonthMar
AccountJanFebMarApr
61000​
100​
150​
125​
100​
AccountSum of Value
61000​
200​
200​
150​
175​
61000
275​
61001​
250​
175​
125​
150​
61001
250​
61001​
150​
150​
125​
125​
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,628
Messages
6,120,618
Members
448,973
Latest member
ChristineC

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