Sum Week To Date Sales

Lewzerrrr

Active Member
Joined
Jan 18, 2017
Messages
256
Hi

I have a 26 week daily sales data dump that I need to sum X week week to date

I have my week number (1, 2.. 26) along row 1, split out by Sunday, Monday... Saturday in row 2 with sales data below

Below is required output, how can I go about this?

111111122222223333333
ProductSundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturday
A88705778298744785387916849971510482065786
B3111177944483698100323434878496163102372
C1007955963756907458847670127265605859868836
D298921281518502024111444331323365355548
E64625419230165145454110965225935767633
Product:C
Week:2
Day:Thursday
Result:362

<tbody>
</tbody>

Thanks
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi,

Assuming your data table, Product, Week and Day are in A1:V8, B9, B10 and B11 respetively:

=SUMPRODUCT(SUMIFS(INDEX(A:XFD,MATCH(B9,A:A,0),0),1:1,B10,2:2,CHOOSE(MATCH(LEFT(B11,2),{"F","M","S","Su","T","Tu","W"}),"<>Sa",{"Su","M"},"*","Su",{"Su","M","T","W"},{"Su","M","Tu"},{"Su","M","Tu","W"})&"*"))

Regards
 
Last edited:
Upvote 0
Hi,

Assuming your data table, Product, Week and Day are in A1:V8, B9, B10 and B11 respetively:

=SUMPRODUCT(SUMIFS(INDEX(A:XFD,MATCH(B9,A:A,0),0),1:1,B10,2:2,CHOOSE(MATCH(LEFT(B11,2),{"F","M","S","Su","T","Tu","W"}),"<>Sa",{"Su","M"},"*","Su",{"Su","M","T","W"},{"Su","M","Tu"},{"Su","M","Tu","W"})&"*"))

Regards

Thank you, this looks like the devils formula!

I used a helper column for now, inserted before column A. A3 = =SUM(INDEX(C3:W3,MATCH($C$10,$C$1:$W$1,0)):INDEX(C3:W3,MATCH(1,($C$10=$C$1:$W$1)*($C$11=$C$2:$W$2),0))) (Ctrl Shift Enter) and C12 = =INDEX(A3:A7,MATCH(C9,B3:B7,0))

Thanks
 
Upvote 0
Try:


Excel 2010
ABCDEFGHIJKLMNOPQRSTUV
1111111122222223333333
2ProductSundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturday
3A88705778298744785387916849971510482065786
4B3111177944483698100323434878496163102372
5C1007955963756907458847670127265605859868836
6D298921281518502024111444331323365355548
7E64625419230165145454110965225935767633
8
9Product:C
10Week:2
11Day:Thursday
12Result:362
Sheet5
Cell Formulas
RangeFormula
B12=SUM(OFFSET(INDEX($B$3:$V$7,MATCH(B9,$A$3:$A$7,0),MATCH(B10,$B$1:$V$1,0)),,,,MATCH(B11,$B$2:$H$2,0)))


or:

=SUMPRODUCT((($A$3:$A$7=B9)*$B$1:$V$1=B10)*(MOD(COLUMN(B1:V1)-2,7)+1<=MATCH(B11,B2:H2,0))*$B$3:$V$7)


Weekday, weeknum, etc. works if the headers are actual dates.

Of course the solution is even easier when your data is in normal, unpivoted format.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,715
Members
448,985
Latest member
chocbudda

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