Create a count of cells for unique locations by months

nserrano

New Member
Joined
Oct 27, 2016
Messages
4
Hi everyone,

Happy Monday to you all. I need to build on the formulas that were created last week for counting visit statuses per location (with many thanks to you for help!) - Now the need is to count the number of visits that fall within a date range for each unique location. For example, with the following data on Tab 2:



A
B
C
D
E
F
G
H
I
J
K
L
M
1
Location
ID
Site Visit 1
Visit 1 Status
Site Visit 2
Visit 2 Status
Site Visit 3
Visit 3 Status
Location
Nbr of ^
Nbr of #
Nbr of *
2
1
ABCD-123
1-Mar-14
^
5-Apr-14
#
10-May-14
*
1
3
3
3
3
1
ABCD-456
1-Mar-14
#
10-May-14
#
4-July-14
*
2
4
4
1
4
1
ABCD-789
5-Jan-14
^
4-Feb-14
^
10-Mar-14
*
3
2
3
4
5
2
WXYZ-098
3-Feb-14
^
10-Mar-14
#
15-May-14
#
6
2
WXYZ-765
6-Apr-14
#
1-May-14
^
4-June-14
#
7
2
WXYZ-432
10-Mar-14
*
1-May-14
^
4-June-14
^
8
3
LMNO-123
16-Apr-14
#
15-June-14
*
15-July-14
#
9
3
LMNO-456
1-Mar-14
*
1-Apr-14
^
5-May-14
*
10
3
LMNO-789
10-Apr-14
^
1-May-14
#
15-June-14
*

<tbody>
</tbody>


We would need an output on Tab1 of:
Location
Site Visits in Mar 2014
Site visits in April 2014
Site visits in May 2014
Site visits in June 2014
1
3
1
2
2
2
1
3
2
3
1
3
2
2

<tbody>
</tbody>


My existing formulas are:
=SUMPRODUCT(('Tab 2'!$A2:$A10=A2)*('Tab 2'!$C$2:$G$10="*"))
=SUMPRODUCT(('Tab 2'!$A2:$A10=A2)*('Tab 2'!$C$2:$G$10="#"))
=SUMPRODUCT(('Tab 2'!$A2:$A10=A2)*('Tab 2'!$C$2:$G$10="^"))

In this new calculation, status doesn't matter, so I have

1. just taken one of the formulas above: =SUMPRODUCT(('Tab 2'!$A2:$A10=A2)*('Tab 2'!$C$2:$G$10="#"))
2. and would like to add a search for cells that contain the string "Site": SUMPRODUCT(--ISNUMBER(SEARCH({"site"},Tab 2'!$A1:$H1)))>0)
3. and also the condition that the dates must fall within a date range to be counted: IF('Tab 2'!C1:H10>=DATE(2014,03,01)) AND ('Tab 2'!C1:H10<=DATE(2014,03,31)) (and the same for ranges of April 1 - April 30, May 1 - May 31 and June 1 and June 30)

How can I combine these correctly?

Thanks for any help you can provide!

Natasha
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi everyone,

Would an array of dates help with this calculation? And can an IF statement be nested within a SUMPRODUCT statement?
 
Upvote 0

Forum statistics

Threads
1,216,196
Messages
6,129,462
Members
449,511
Latest member
OttosArmy

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