Total of sum

jvlavl

New Member
Joined
Nov 27, 2017
Messages
15
Hello,

Can somebody help me with this formula

I have a excel With a number of columns

[TABLE="width: 1161"]
<tbody>[TR]
[TD="width: 59"][/TD]
[TD="class: xl117, width: 56"][/TD]
[TD="class: xl117, width: 159"][/TD]
[TD="class: xl115, width: 155"][/TD]
[TD="class: xl117, width: 126"][/TD]
[TD="class: xl117, width: 126"][/TD]
[TD="class: xl117, width: 126"][/TD]
[TD="class: xl117, width: 118"][/TD]
[TD="class: xl117, width: 118"][/TD]
[TD="class: xl117, width: 118"][/TD]
[/TR]
[TR]
[TD="width: 59"]Country [/TD]
[TD="class: xl117, width: 56"]Id[/TD]
[TD="class: xl117, width: 159"]Title[/TD]
[TD="class: xl115, width: 155"]CreationDate[/TD]
[TD="class: xl117, width: 126"][/TD]
[TD="class: xl117, width: 126"][/TD]
[TD="class: xl117, width: 126"][/TD]
[TD="class: xl117, width: 118"][/TD]
[TD="class: xl117, width: 118"][/TD]
[TD="class: xl117, width: 118"][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 429"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]AU[/TD]
[TD="align: right"]26[/TD]
[TD]F[/TD]
[TD="align: right"]22/02/2018[/TD]
[/TR]
[TR]
[TD]DE[/TD]
[TD="align: right"]190[/TD]
[TD]Et[/TD]
[TD="align: right"]22/02/2017[/TD]
[/TR]
[TR]
[TD]DE[/TD]
[TD="align: right"]242[/TD]
[TD]E[/TD]
[TD="align: right"]21/02/2018[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]277[/TD]
[TD]C[/TD]
[TD="align: right"]20/02/2017[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]277[/TD]
[TD][A[/TD]
[TD="align: right"]19/02/2018[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]267[/TD]
[TD]Rt[/TD]
[TD="align: right"]18/02/2018[/TD]
[/TR]
[TR]
[TD]DE[/TD]
[TD="align: right"]267[/TD]
[TD]A[/TD]
[TD="align: right"]14/02/2017[/TD]
[/TR]
[TR]
[TD]DE[/TD]
[TD="align: right"]269[/TD]
[TD]S[/TD]
[TD="align: right"]14/02/2018[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]297[/TD]
[TD]S[/TD]
[TD="align: right"]14/02/2018[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]525[/TD]
[TD]Es[/TD]
[TD="align: right"]10/02/2018[/TD]
[/TR]
[TR]
[TD]DE[/TD]
[TD="align: right"]433[/TD]
[TD]E[/TD]
[TD="align: right"]10/02/2018[/TD]
[/TR]
[TR]
[TD]DE[/TD]
[TD="align: right"]379[/TD]
[TD]Se[/TD]
[TD="align: right"]10/02/2018[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]325[/TD]
[TD]Et[/TD]
[TD="align: right"]10/02/2017[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]306[/TD]
[TD]C[/TD]
[TD="align: right"]10/02/2018[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]733[/TD]
[TD]F[/TD]
[TD="align: right"]09/02/2018[/TD]
[/TR]
[TR]
[TD]DE[/TD]
[TD="align: right"]414[/TD]
[TD]Es[/TD]
[TD="align: right"]09/02/2017[/TD]
[/TR]
[TR]
[TD]DE[/TD]
[TD="align: right"]328[/TD]
[TD]Es[/TD]
[TD="align: right"]08/02/2018[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]327[/TD]
[TD]Es[/TD]
[TD="align: right"]08/02/2017[/TD]
[/TR]
[TR]
[TD]DE[/TD]
[TD="align: right"]322[/TD]
[TD]C[/TD]
[TD="align: right"]08/02/2017[/TD]
[/TR]
[TR]
[TD]AU[/TD]
[TD="align: right"]203[/TD]
[TD]Es[/TD]
[TD="align: right"]08/02/2017[/TD]
[/TR]
</tbody>[/TABLE]

What I want is the to get the count on per year together with the Country

Year 2017 in combination with AU has a count of 4
Year 2017 in combination with DE has a count of 4
Year 2018 in combination with AU has a count of 6
Year 2018 in combination with DE has a count of 5

Also I want to the same selection per country per month.

Thanks in advance

Rgds,

John
 

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.
Is this what you want?


Excel 2010
ABCD
1CountryIdTitleCreationDate
2AU26F2/22/2018
3DE190Et2/22/2017
4DE242E2/21/2018
5AU277C2/20/2017
6AU277[A2/19/2018
7AU267Rt2/18/2018
8DE267A2/14/2017
9DE269S2/14/2018
10AU297S2/14/2018
11AU525Es10/2/2018
12DE433E10/2/2018
13DE379Se10/2/2018
14AU325Et10/2/2017
15AU306C10/2/2018
16AU733F9/2/2018
17DE414Es9/2/2017
18DE328Es8/2/2018
19AU327Es8/2/2017
20DE322C8/2/2017
21AU203Es8/2/2017
22
23
24AU20174
25DE20174
26AU20187
27DE20185
28
29month
30AU25
31AU82
32AU91
33AU103
34
35DE24
36DE82
37DE91
38DE102
Sheet9
Cell Formulas
RangeFormula
D24=SUMPRODUCT(--($A$2:$A$21=A24),--(YEAR($D$2:$D$21)=B24))
D25=SUMPRODUCT(--($A$2:$A$21=A25),--(YEAR($D$2:$D$21)=B25))
D26=SUMPRODUCT(--($A$2:$A$21=A26),--(YEAR($D$2:$D$21)=B26))
D27=SUMPRODUCT(--($A$2:$A$21=A27),--(YEAR($D$2:$D$21)=B27))
D30=SUMPRODUCT(--($A$2:$A$21=A30),--(MONTH($D$2:$D$21)=B30))
D31=SUMPRODUCT(--($A$2:$A$21=A31),--(MONTH($D$2:$D$21)=B31))
D32=SUMPRODUCT(--($A$2:$A$21=A32),--(MONTH($D$2:$D$21)=B32))
D33=SUMPRODUCT(--($A$2:$A$21=A33),--(MONTH($D$2:$D$21)=B33))
D35=SUMPRODUCT(--($A$2:$A$21=A35),--(MONTH($D$2:$D$21)=B35))
D36=SUMPRODUCT(--($A$2:$A$21=A36),--(MONTH($D$2:$D$21)=B36))
D37=SUMPRODUCT(--($A$2:$A$21=A37),--(MONTH($D$2:$D$21)=B37))
D38=SUMPRODUCT(--($A$2:$A$21=A38),--(MONTH($D$2:$D$21)=B38))
 
Upvote 0
Hi Scott,

Yes it's almost what I want

What if I want the selection to be defined also as month and year = count

For example AU has in month 01 year 2018 9 records
AU has in month 12 year 2017 2 records

When I change a date in 2018 to the 12e month it's counted at the line AU has in month 12 year 2017 2 records goes up with 1 But that needs to stay at 2 and the outcome should be 1 because it's in 2018

When I try this formula
=SUMPRODUCT(--($A$2:$A$21=A24);--(MONTH(D2:D21)="12");--(YEAR(D2:D21="2018")))

I get a value that is not correct.

Thanks in advance.

Rgds,

John
 
Upvote 0
Maby

Excel 2010
ABCD
1CountryIdTitleCreationDate
2AU26F2/22/2018
3DE190Et2/22/2017
4DE242E2/21/2018
5AU277C2/20/2017
6AU277[A2/19/2018
7AU267Rt2/18/2018
8DE267A2/14/2017
9DE269S2/14/2018
10AU297S2/14/2018
11AU525Es10/2/2018
12DE433E10/2/2018
13DE379Se10/2/2018
14AU325Et10/2/2017
15AU306C10/2/2018
16AU733F9/2/2018
17DE414Es9/2/2017
18DE328Es8/2/2018
19AU327Es8/2/2017
20DE322C8/2/2017
21AU203Es8/2/2017
22
23AU
24year20184
25month2
Sheet4
Cell Formulas
RangeFormula
D24=SUMPRODUCT(--($A$2:$A$21=B23),--(MONTH($D$2:$D$21)=B25),--(YEAR($D$2:$D$21)=B24))


When you put a number in quotes like you have it turns it into a text string. The number 12 does NOT equal the text string "12"
Code:
=SUMPRODUCT(--($A$2:$A$21=A24);--(MONTH(D2:D21)=[COLOR=#FF0000]"12"[/COLOR]);--(YEAR(D2:D21=[COLOR=#FF0000]"2018"[/COLOR])))
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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