Count by month ONLY FILTERED columns and exclude blanks

IsabellaLearning

Board Regular
Joined
May 23, 2009
Messages
115
Hi if it was just counting july - i think it would be easy:
=SUMPRODUCT(--(MONTH(f:f)=7))

I would like to count only in the filtered data, only the July 2017s.
The date column in F row is in format dd/mm/yyyy I want to ignore blanks in that row.
I also would like to count by another condition eg:
If column e = shoes then count how many shoes (column e) are sales in July 17.

For my own learning I would like to know how to do it just for the date (showing filtered only) and secondly the filtered date with
the condition of shoes.

any help would be amazing
Izzy
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Re: how to count by month ONLY FILTERED columns and exclude blanks


Unknown
EFGH
1DateTypeSales (in Units)
204/09/2017Dress55
304/10/2017Shoes77
414/07/2017Shoes37
525/05/2017Dress27
628/04/2017Dress66
708/06/2017Dress19
806/08/2017Dress24
908/07/2017Shoes15
1018/07/2017Shoes26
1118/05/2017Shoes49
1218/05/2017Gloves19
1318/05/2017Dress4
1430/07/2017Dress94
1522/04/2017Gloves71
1617/07/2017Shoes81
1725/06/2017Shoes42
1816/07/2017Gloves63
1910/06/2017Gloves67
2014/09/2017Gloves16
2114/12/2017Shoes69
2214/01/2018Dress18
2309/12/2017Gloves3
24
25942
26
27MonthYearTypeCount
28July2017Shoes4
29
Sheet17
Cell Formulas
RangeFormula
H28{=SUMPRODUCT(--(IF(SUBTOTAL(103,OFFSET(H2,ROW($H$2:$H$23)-ROW($H$2),,,)),TEXT($F$2:$F$23,"mmmm")&YEAR($F$2:$F$23)&$G$2:$G$23)=E28&F28&G28))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
Let E5:F600 house the data, including the headers.

E1: shoes (an item/product of interest)

In F1 enter:

=SUMPRODUCT(SUBTOTAL(2,OFFSET(F6,ROW(F6:F600)-ROW(F6),0,1)),--(E6:E600=E2))

Note that the autofilter is applied on column F.


If you are not using autofilter...

=SUMPRODUCT(--(F6:F600-DAY(F6:F600)+1=DATE(2017,7,1)),--(E6:E600=E2))
 
Upvote 0
Thankyou so much I should have said, auto filters are on both columns....


I actually became mesmerized and started to attempt ways to look through all the data without filtering: what do you make of this forumula I came up with to count only if H has the word Employee and then count everything EXCEPT the word NZ? It comes back with a zero which is not correct.


=SUMIFS('QREC New Test Report'!A:A,'QREC New Test Report'!H:H,"Employee",'QREC New Hire Report'!J:J,"<>*NZ*")


Izzy

Let E5:F600 house the data, including the headers.

E1: shoes (an item/product of interest)

In F1 enter:

=SUMPRODUCT(SUBTOTAL(2,OFFSET(F6,ROW(F6:F600)-ROW(F6),0,1)),--(E6:E600=E2))

Note that the autofilter is applied on column F.


If you are not using autofilter...

=SUMPRODUCT(--(F6:F600-DAY(F6:F600)+1=DATE(2017,7,1)),--(E6:E600=E2))
 
Upvote 0
Thankyou so much I should have said, auto filters are on both columns....

That shouldn't matter for the SumProduct formula with Offset...


I actually became mesmerized and started to attempt ways to look through all the data without filtering: what do you make of this forumula I came up with to count only if H has the word Employee and then count everything EXCEPT the word NZ? It comes back with a zero which is not correct.

=SUMIFS('QREC New Test Report'!A:A,'QREC New Test Report'!H:H,"Employee",'QREC New Hire Report'!J:J,"<>*NZ*")

Izzy

The SumIfs formula that you have appears to sum the A column while H equals employee and J on a different sheet does not contain NZ.

25,employee,life in NZ easy
40,employee,duncea
20,employee,#
60,administrator,gardea

# means an empty cell in the foregoing data set. Your SumIfs formula should yield here a total of 60 if both Test and Hire sheets exist and they contain appropriate data.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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