Solved

# Sum by Week

Posted on 2016-09-01
Medium Priority
61 Views
Experts,

What would be the formula to sum by week?
Weekly-Sum.xlsx
0
Question by:pdvsa
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 33

Accepted Solution

Subodh Tiwari (Neeraj) earned 2000 total points
ID: 41779550
One way is to create a helper row#3 and then use the following formula in A7 and copy across.
``````=IF(A3=B3,"",SUMPRODUCT((\$A\$3:\$R\$3=A3)*\$A\$2:\$R\$2))
``````
Weekly-Sum.xlsx
1

LVL 18

Expert Comment

ID: 41779797
Hi, you can use a combination of weeknum (for which you need Analysis Toolpak) to correctly get the week number of each date entry and then a sumif formula (the weeknum formula can't be used with the SUMPRODUCT formula suggested above).

I suggest doing the following.
You have dates in Row1 and amounts in row 2.
In row 3 create =WEEKNUM(A1) [ copy across this as far as needed ]
In row 4, list all calender weeks (i.e., 1,2,3,4,....) via AutoFill.
In row 5, enter: =SUMIF(\$A\$3:\$R\$3,A4,\$A\$2:\$R\$2) [ copy across as far as needed ]

Hope this helps!
Weekly-Sum_example.xlsx
0

LVL 22

Expert Comment

ID: 41780251
Analysis ToolPak formulas are included in Excel's Functions now, no need to install it.

If the data was vertical instead of horizontal then a PivotTable would be a good solution
0

Author Closing Comment

ID: 41781061
Nice...very nice.  Thank you!
0

LVL 33

Expert Comment

ID: 41781065
Thanks for the feedback.
0

## Featured Post

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
###### Suggested Courses
Course of the Month15 days, 6 hours left to enroll