Help adding multiple instances based on date.

GazNicki

Board Regular
Joined
Nov 30, 2010
Messages
78
Hi

Please bear with me on this one.

I have a large spreadsheet (layout below) which tracks the sale of items (listed down in column A) by customer. Each customer takes a range of items, so therefore there are multiple instances of these items in Column A.

In row 1, starting at cell B2 is the week ending date. (Cell A2 contains the weekending date as a number currently too). The sheet spans across from B2:BC2 as the weeks go along the top.

On a separate worksheet in the same workbook, I want to sum up all the instances of an item, but specific to one week. I can use SUMIF or SUMPRODUCT, but that requires me to define a range which is static, but I want the week to change.

I have tried to use SUMIFS in order to define two criteria, but I am presented with a #VALUE ! error everytime. I am assuming this is because one of my ranges is vertical and the other horizontal. Is this the case, or have I done something wrong?

[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][/TD]
[TD]43106[/TD]
[TD]43113[/TD]
[TD]43120[/TD]
[TD]43127[/TD]
[TD]43134[/TD]
[TD]43141[/TD]
[TD]43148[/TD]
[TD]43155[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD]06 Jan[/TD]
[TD]13 Jan[/TD]
[TD]20 Jan[/TD]
[TD]27 Jan[/TD]
[TD]03 Feb[/TD]
[TD]10 Feb[/TD]
[TD]17 Feb[/TD]
[TD]24 Feb[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Item 1[/TD]
[TD]71088[/TD]
[TD]62959[/TD]
[TD]15248[/TD]
[TD]11246[/TD]
[TD]10224[/TD]
[TD]0[/TD]
[TD]45774[/TD]
[TD]45114[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Item 1[/TD]
[TD]11457[/TD]
[TD]44584[/TD]
[TD]32551[/TD]
[TD]45445[/TD]
[TD]10884[/TD]
[TD]0[/TD]
[TD]54112[/TD]
[TD]45234[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Item 2[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]12245[/TD]
[TD]111254[/TD]
[TD]12557[/TD]
[TD]1245[/TD]
[TD]15996[/TD]
[TD]45455[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Item 3[/TD]
[TD]122245[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]11112[/TD]
[TD]45458[/TD]
[TD]77855[/TD]
[TD]84451[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
try this sumproduct() solution


Excel 2013/2016
ABCDEFGHI
14310643113431204312743134431414314843155
206-Jan13-Jan20-Jan27-Jan03-Feb10-Feb17-Feb24-Feb
3Item 1710886295915248112461022404577445114
4Item 1114574458432551454451088405411245234
5Item 200122451112541255712451599645455
6Item 312224500011112454587785584451
7
8
917-Feb
10Item 199886
Sheet2
Cell Formulas
RangeFormula
B10=SUMPRODUCT($B$3:$I$6,(A3:A6=A10)*(B2:I2=B9))
 
Upvote 0
Hello,

Please see if pivot option can help.

For data like this:
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"][TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]Items[/TD]
[TD="width: 64"]Week1[/TD]
[TD="width: 64"]Week2[/TD]
[TD="width: 64"]Week3[/TD]
[/TR]
[TR]
[TD]Item1[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]Item1[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]24[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Item1[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]23[/TD]
[/TR]
[TR]
[TD]Item2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Item2[/TD]
[TD="align: right"]22[/TD]
[TD][/TD]
[TD="align: right"]54[/TD]
[/TR]
[TR]
[TD]Item3[/TD]
[TD="align: right"]21[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]32[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]


Pivot can do this:

[TABLE="width: 386"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD]Row Labels[/TD]
[TD]Sum of Week1[/TD]
[TD]Sum of Week2[/TD]
[TD]Sum of Week3[/TD]
[/TR]
[TR]
[TD]Item1[/TD]
[TD="align: right"]44[/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]28[/TD]
[/TR]
[TR]
[TD]Item2[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]58[/TD]
[/TR]
[TR]
[TD]Item3[/TD]
[TD="align: right"]21[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]32[/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD="align: right"]89[/TD]
[TD="align: right"]105[/TD]
[TD="align: right"]118[/TD]
[/TR]
</tbody>[/TABLE]
[TR]
[TD="align: right"][/TD]
[/TR]

</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

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