Solved

# Sumifs with more than one column as sum range

Posted on 2015-01-27
123 Views
Hi Experts,

I have an excel spreadsheet with three tabs: Summary, Data and Settings.

In the summary tab i want to use a a formula that shows balances across the columns per each account in each row. The formula will read from the data tab where I have define names for each column as Per1, Per2, Per3.

so, the summary tab will return Bal_2 as the sum of Per1 and Per2; Bal_3 as the sum of Per1...Per3

I have used sum products and sumifs, but I think the issue I have is that sumifs won't sum range more than one column. See my spreadsheet  attached.
test.xlsx
0
Question by:Pachecda

LVL 25

Expert Comment

ID: 40574114
you made that over complicated with so many confusing named ranges.

here is the solution you need. see attached.
test.xlsx
0

Author Comment

ID: 40574155
HI ProfessorJimjam.

I saw the spreadsheet with the updated formulas and I see that your solution is adding the current period plus the previous column balance as seen in the "+sum(C2:C2)". However, I was hoping for a more dynamic array as the formula below is dependent upon the previous column, which it may not work if the defined names are shuffled around the columns.

In theory, I was thinking to have a defined name Bal_2 (_Per_1+_Per_2)

Bal_2 = Per_1+Per_2
Bal_3=Per_1+Per_2+Per_3
....etc
I sure hope there is another way where the balances are not relying on a previous column.
0

LVL 32

Expert Comment

ID: 40575084
See attached.

On Data tab I have added 12 columns to the right which is the cumulative total to date for each row.

The summary tab then uses a SUMIF formula on account and sums the individual cumulative columns.

If your headers were dates rather than Period headings, you could use a two directional SUMIFS, ie look top to bottom in column A for Account number and look left to right in lets say row 1 for a date and only add up where less than or equal to specified date for column in Summary. I think that would work. Edit: Scrap that bit, just tried and wouldn't work.

Hope this helps.
Rob H
test1.xlsx
0

Accepted Solution

Pachecda earned 0 total points
ID: 40575544
Hi Rob,

Thanks for your help on this. Although creating the additional twelve columns for cumulative balances works, I was hoping to be able to this via an array and defined names rather than relying on additional twelve columns for cumulative balances.

Last night I took a different approach and used the array formula {=sum(if((Accounts=account),Bal_2))} where "Bal_2" is a defined name with the sum of Indirect (_Per_1)+indirect(_Per_2).  The formula works like a charm, the only issue is that now I want to make the "Bal_2"  to be referenced to another cell where the user chooses what balance to analyse, and I can't seem to make it work.

Then I thought, if the array formula above works, why wouldn't the sumproduct or the sumifs work. So, I created two additional summary tables right below the array formulas for comparison and it seems two work for Bal_1, but not for the other balances.

Please see the attached file and you will see that I tried to compare the three different formulas using the same approach with the defined names.
test2.xlsx
0

LVL 46

Expert Comment

ID: 40627777
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.