How can I add up negative sales for each week of the year? (I'm almost there I think...)

fitzchivalry

New Member
Joined
Mar 23, 2015
Messages
33
Hi

I want to add up a column of transactions, including only negative amounts, and display this by week no and month no.

I've already found out how to add up all sales (as below), but I can't figure out how to change it to only include negative amounts.

The formulas below add up everything. Having read about combining SUMPRODUCT and SUMIF my best guesses for Negative Sales for each week were:

Code:
=SUMPRODUCT((WEEKNUM($A:$A+0)=$D2)*1,(SUMIF($B:$B,"<0",$B:$B)

This returns #VALUE!, and I've tried using the Formula Evaluator to step through the results but I don't really know what I'm doing...

And for each month:

Code:
=SUMPRODUCT((WEEKNUM($A:$A+0)=$E2)*1,$B:$B*($B:$B="<0"))

This returns £0.00.

I'm still trying to crack this one, but have been stuck for a while... (despite the complexity of the formulas I'm using, I still consider myself a novice). If you read this within a couple of hours of this post, I'm likely still online working on this, help very much appreciated!

Date (A)Sale Amount (B)Week No (J)WeekNum (H)
01/01/2015101=(WEEKNUM($A2)=$J2)
13/01/2015-52=(WEEKNUM($A3)=$J3)
05/02/2015253=(WEEKNUM($A4)=$J4)
20/02/2015-54Etc...
04/03/2015405
21/04/2015-206
09/05/2015157
10/06/2015258
20/06/201525Etc...

<tbody>
</tbody>

Today (C)Week No (D)Week Total (E)Month No (F)Month Total (G)Year No (H)Year Total (I)
=SUMIF($A:$A, TODAY(),$B:$B)1=SUMPRODUCT((WEEKNUM($A:$A+0)=$D2)*1,$B:$B)1=SUMPRODUCT((WEEKNUM($A:$A+0)=F2)*1,$B:$B)2013=SUMPRODUCT((YEAR($A:$A)=$H2)*($B:$B))
2=SUMPRODUCT((WEEKNUM($A:$A+0)=$D3)*1,$B:$B)2=SUMPRODUCT((WEEKNUM($A:$A+0)=F3)*1,$B:$B)2014=SUMPRODUCT((YEAR($A:$A)=$H3)*($B:$B))
3=SUMPRODUCT((WEEKNUM($A:$A+0)=$D4)*1,$B:$B)3=SUMPRODUCT((WEEKNUM($A:$A+0)=F4)*1,$B:$B)2015=SUMPRODUCT((YEAR($A:$A)=$H4)*($B:$B))
4Etc...4Etc...Etc...
55
66
77
88
99
1010
1111
1212
13
14
15
16
17
18
Etc...

<tbody>
</tbody>

P.S: Thanks Aladdin (for Month Total) and Barry Houdini (for Week Total; I had trouble with WEEKNUM) for previous posts that have enabled me to get this far - I'm talking about historical posts on this forum that I found, not answers to questions I myself posted.
 
Last edited:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I've just the answers, through Scott Huish's post here (thank you :) ) http://www.mrexcel.com/forum/excel-...egative-positives-conditions.html#post4135424

Answer are, for month:

Code:
=ABS(SUMPRODUCT(--(MONTH($A:$A)=$F2),--($B:$B<0),$B:$B))

And for by week:

Code:
=ABS(SUMPRODUCT(--(WEEKNUM($A:$A+0)=$F2)*1,--($B:$B<0),$B:$B))

I need to work out the number for each week and month too (the count) of negative transactions, but I'll work on that tomorrow.. for day it's

Code:
=COUNTIFS($B:$B,"<0",$A:$A,TODAY())
 
Upvote 0

Forum statistics

Threads
1,215,172
Messages
6,123,447
Members
449,100
Latest member
sktz

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