Count If with multiple criteria and unique values

dixon1983

Board Regular
Joined
Apr 23, 2005
Messages
175
Hi,
I dont know if this is possible or not but thought I'd ask anyway.

I have a sheet of data and want to run a count on the values in Column A with the following criteria:

- If the value in column B is repeated then the value in column A can only be counted once...
- Column C must equal 'M'.


Example:
A.....B.....C
1.....42....M
1.....42....M
2.....41....A
2.....41....M
1.....56....M


In this example 1 would be counted 2 times, and 2 would be counted once.

I have about 15 sheets of data like this and would like a master sheet to look into each sheet and give me a count of each so id prefer to not use the advanced filter => unique variables option if possible.

Any help would be greatly appreciated.

Dixon.
 
The method that evolved in this thread is amazing. May I bump the thread with a question though?

My personalised formula works ok until I add the wildcard in the last IF - $F5&"*". During trial and error, replacing that with $F5 and adjusting F5 to a precise value, it works. Any ideas??
Code:
=SUM(IF(FREQUENCY(
IF(1-(Export!$B2:$B40000=""),
IF(Export!$M2:$M40000>=G$2,
IF(Export!$M2:$M40000<=J$2,
IF(Export!$D2:$D40000=$B5,
IF(Export!$F2:$F40000=$D5,
[B]IF(Export!$K2:$K40000=$F5&"*"[/B],
MATCH(Export!B2:B40000,Export!B2:B40000,0))))))),ROW(Export!B2:B40000)-ROW(Export!B2)+1),1))

Control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(
      IF(1-(Export!$B$2:$B$40000=""),
      IF(Export!$M$2:$M$40000>=G$2,
      IF(Export!$M$2:$M$40000<=J$2,
      IF(Export!$D$2:$D$40000=$B5,
      IF(Export!$F$2:$F$40000=$D5,
      IF(ISNUMBER(SEARCH("|"&$F5,"|"&Export!$K2:$K40000)),
      MATCH(Export!$B$2:$B$40000,Export!$B$2:$B$40000,0))))))),
       ROW(Export!$B$2:$B$40000)-ROW(Export!$B$2)+1),1))

Hope the speed of performance will be bearable.
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Holy crap, what's that "|" sorcery? Can you please explain what's happening? :)

Searching for say da in a range consisting of

daque
ada
nada

where we only want to pick out daque, not ada or nada, we can better search:

|da

in:

|daque
|ada
|nada

It works, but I'll only know if it's bearable when the report extends to it's ultimate size. Which will be soon.

You might then want to consider other means like SQL for example.
 
Upvote 0
Hi,
Recently I ran into a problem where I unable to get the formula right. Need a helping hand.

I have following data

[TABLE="width: 298"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Ticket no[/TD]
[TD]Date[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]TT-000030817681[/TD]
[TD="align: right"]12/30/2016[/TD]
[TD="align: right"]60[/TD]
[/TR]
[TR]
[TD]TT-000030817681[/TD]
[TD="align: right"]12/30/2016[/TD]
[TD="align: right"]60[/TD]
[/TR]
[TR]
[TD]TT-000030817681[/TD]
[TD="align: right"]12/30/2016[/TD]
[TD="align: right"]60[/TD]
[/TR]
[TR]
[TD]TT-000030819464[/TD]
[TD="align: right"]12/30/2016[/TD]
[TD="align: right"]24[/TD]
[/TR]
[TR]
[TD]TT-000030826520[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]93[/TD]
[/TR]
[TR]
[TD]TT-000030826520[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]77[/TD]
[/TR]
[TR]
[TD]TT-000030819811[/TD]
[TD="align: right"]12/30/2016[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD]TT-000030827310[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]104[/TD]
[/TR]
[TR]
[TD]TT-000030811346[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]81[/TD]
[/TR]
[TR]
[TD]TT-000030826521[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD]TT-000030826521[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD]TT-000030826521[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]17[/TD]
[/TR]
[TR]
[TD]TT-000030826521[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]29[/TD]
[/TR]
[TR]
[TD]TT-000030826521[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]92[/TD]
[/TR]
[TR]
[TD]TT-000030826521[/TD]
[TD="align: right"]12/31/2016[/TD]
[TD="align: right"]72[/TD]
[/TR]
</tbody>[/TABLE]

What I need is Max Value of Amount of Each unique ticket aggregated on date.

Something like this:

[TABLE="width: 242"]
<colgroup><col span="2"></colgroup><tbody>[TR]
[TD]Date[/TD]
[TD]Total Amount[/TD]
[/TR]
[TR]
[TD]12/31/2016[/TD]
[TD]370[/TD]
[/TR]
[TR]
[TD]12/30/2016[/TD]
[TD]129[/TD]
[/TR]
</tbody>[/TABLE]


The working of the above result would be based on:
[TABLE="width: 363"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD]Ticket no[/TD]
[TD] Max of Amount[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]TT-000030811346[/TD]
[TD] 81[/TD]
[TD]12/31/2016[/TD]
[/TR]
[TR]
[TD]TT-000030817681[/TD]
[TD] 60[/TD]
[TD]12/30/2016[/TD]
[/TR]
[TR]
[TD]TT-000030819464[/TD]
[TD] 24[/TD]
[TD]12/30/2016[/TD]
[/TR]
[TR]
[TD]TT-000030819811[/TD]
[TD] 45[/TD]
[TD]12/30/2016[/TD]
[/TR]
[TR]
[TD]TT-000030826520[/TD]
[TD] 93[/TD]
[TD]12/31/2016[/TD]
[/TR]
[TR]
[TD]TT-000030826521[/TD]
[TD] 92[/TD]
[TD]12/31/2016[/TD]
[/TR]
[TR]
[TD]TT-000030827310[/TD]
[TD] 104[/TD]
[TD]12/31/2016

[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
@djawaz

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][/tr][tr][td]
1​
[/td][td]Ticket no[/td][td]Date[/td][td]Amount[/td][td][/td][td]Date[/td][td]Total Amount[/td][/tr]
[tr][td]
2​
[/td][td]TT-000030817681[/td][td]
12/30/2016
[/td][td]
60
[/td][td][/td][td]
12/31/2016
[/td][td]
370
[/td][/tr]
[tr][td]
3​
[/td][td]TT-000030817681[/td][td]
12/30/2016
[/td][td]
60
[/td][td][/td][td]
12/30/2016
[/td][td]
129
[/td][/tr]
[tr][td]
4​
[/td][td]TT-000030817681[/td][td]
12/30/2016
[/td][td]
60
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
5​
[/td][td]TT-000030819464[/td][td]
12/30/2016
[/td][td]
24
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
6​
[/td][td]TT-000030826520[/td][td]
12/31/2016
[/td][td]
93
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
7​
[/td][td]TT-000030826520[/td][td]
12/31/2016
[/td][td]
77
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
8​
[/td][td]TT-000030819811[/td][td]
12/30/2016
[/td][td]
45
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
9​
[/td][td]TT-000030827310[/td][td]
12/31/2016
[/td][td]
104
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
10​
[/td][td]TT-000030811346[/td][td]
12/31/2016
[/td][td]
81
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
11​
[/td][td]TT-000030826521[/td][td]
12/31/2016
[/td][td]
15
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
12​
[/td][td]TT-000030826521[/td][td]
12/31/2016
[/td][td]
13
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
13​
[/td][td]TT-000030826521[/td][td]
12/31/2016
[/td][td]
17
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
14​
[/td][td]TT-000030826521[/td][td]
12/31/2016
[/td][td]
29
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
15​
[/td][td]TT-000030826521[/td][td]
12/31/2016
[/td][td]
92
[/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
16​
[/td][td]TT-000030826521[/td][td]
12/31/2016
[/td][td]
72
[/td][td][/td][td][/td][td][/td][/tr]
[/table]


A2:A16 is named as Ticket in Name Manager; B2:B16 as Date, and C2:C16 as Amount.

Define also Ivec in Name Manager as referring to:

=ROW(Ticket)-ROW(INDEX(Ticket,1,1))+1

In F2 control+shift+enter, not just enter, and copy down:

=SUM(MAXIFS(Amount,Ticket,IF(FREQUENCY(IF(1-(Ticket=""),IF(Date=E2,MATCH(Ticket,Ticket,0))),Ivec),Ticket),Date,E2))

MAXIFS requires at least a 2016 Excel version.
 
Upvote 0
@djawaz

[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
A​
[/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[TD]
D​
[/TD]
[TD]
E​
[/TD]
[TD]
F​
[/TD]
[/TR]
[TR]
[TD]
1​
[/TD]
[TD]Ticket no[/TD]
[TD]Date[/TD]
[TD]Amount[/TD]
[TD][/TD]
[TD]Date[/TD]
[TD]Total Amount[/TD]
[/TR]
[TR]
[TD]
2​
[/TD]
[TD]TT-000030817681[/TD]
[TD]
12/30/2016
[/TD]
[TD]
60
[/TD]
[TD][/TD]
[TD]
12/31/2016
[/TD]
[TD]
370
[/TD]
[/TR]
[TR]
[TD]
3​
[/TD]
[TD]TT-000030817681[/TD]
[TD]
12/30/2016
[/TD]
[TD]
60
[/TD]
[TD][/TD]
[TD]
12/30/2016
[/TD]
[TD]
129
[/TD]
[/TR]
[TR]
[TD]
4​
[/TD]
[TD]TT-000030817681[/TD]
[TD]
12/30/2016
[/TD]
[TD]
60
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
5​
[/TD]
[TD]TT-000030819464[/TD]
[TD]
12/30/2016
[/TD]
[TD]
24
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
6​
[/TD]
[TD]TT-000030826520[/TD]
[TD]
12/31/2016
[/TD]
[TD]
93
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
7​
[/TD]
[TD]TT-000030826520[/TD]
[TD]
12/31/2016
[/TD]
[TD]
77
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8​
[/TD]
[TD]TT-000030819811[/TD]
[TD]
12/30/2016
[/TD]
[TD]
45
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
9​
[/TD]
[TD]TT-000030827310[/TD]
[TD]
12/31/2016
[/TD]
[TD]
104
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
10​
[/TD]
[TD]TT-000030811346[/TD]
[TD]
12/31/2016
[/TD]
[TD]
81
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
11​
[/TD]
[TD]TT-000030826521[/TD]
[TD]
12/31/2016
[/TD]
[TD]
15
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
12​
[/TD]
[TD]TT-000030826521[/TD]
[TD]
12/31/2016
[/TD]
[TD]
13
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
13​
[/TD]
[TD]TT-000030826521[/TD]
[TD]
12/31/2016
[/TD]
[TD]
17
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
14​
[/TD]
[TD]TT-000030826521[/TD]
[TD]
12/31/2016
[/TD]
[TD]
29
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
15​
[/TD]
[TD]TT-000030826521[/TD]
[TD]
12/31/2016
[/TD]
[TD]
92
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
16​
[/TD]
[TD]TT-000030826521[/TD]
[TD]
12/31/2016
[/TD]
[TD]
72
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


A2:A16 is named as Ticket in Name Manager; B2:B16 as Date, and C2:C16 as Amount.

Define also Ivec in Name Manager as referring to:

=ROW(Ticket)-ROW(INDEX(Ticket,1,1))+1

In F2 control+shift+enter, not just enter, and copy down:

=SUM(MAXIFS(Amount,Ticket,IF(FREQUENCY(IF(1-(Ticket=""),IF(Date=E2,MATCH(Ticket,Ticket,0))),Ivec),Ticket),Date,E2))

MAXIFS requires at least a 2016 Excel version.


Thank you Aladin. Your input was indeed quite helpful.
So here is the formula which can work in Excel 2013:

=SUM(IF(Date=E2,(MATCH(Ticket,IF(COUNTIFS(Ticket,Ticket,Amount,">"&Amount,Date,E2)=0,Ticket),0)=ROW(Ticket)-MIN(ROW(Ticket))+1)*Amount))
 
Upvote 0
Thank you Aladin. Your input was indeed quite helpful.
So here is the formula which can work in Excel 2013:

=SUM(IF(Date=E2,(MATCH(Ticket,IF(COUNTIFS(Ticket,Ticket,Amount,">"&Amount,Date,E2)=0,Ticket),0)=ROW(Ticket)-MIN(ROW(Ticket))+1)*Amount))

You are welcome. You could have used Ivec too:

{=SUM(IF(Date=E2,IF(MATCH(Ticket,IF(COUNTIFS(Ticket,Ticket,Amount,">"&Amount,Date,E2)=0,Ticket),0)=Ivec,Amount)))}
 
Upvote 0
Hi - I tried figuring my problem, very similar to this thread,hoping someone can help out.

Please look table below:

Column
A B C D E F

[TABLE="width: 662"]
<tbody>[TR]
[TD]BOLAS R F[/TD]
[TD]ANN[/TD]
[TD="align: right"]20/01/2016[/TD]
[TD="align: right"]08/02/2016[/TD]
[TD="align: right"]38.22[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]BOLAS R F[/TD]
[TD]ANN[/TD]
[TD="align: right"]20/01/2016[/TD]
[TD="align: right"]08/02/2016[/TD]
[TD="align: right"]57.33[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]BOLAS R F[/TD]
[TD]ANN[/TD]
[TD="align: right"]09/08/2016[/TD]
[TD="align: right"]09/08/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]CCLES L[/TD]
[TD]PER[/TD]
[TD="align: right"]27/05/2016[/TD]
[TD="align: right"]27/05/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]CCLES L[/TD]
[TD]ANN[/TD]
[TD="align: right"]22/01/2016[/TD]
[TD="align: right"]27/01/2016[/TD]
[TD="align: right"]22.05[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]CCLES L[/TD]
[TD]ANN[/TD]
[TD="align: right"]01/03/2016[/TD]
[TD="align: right"]01/03/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]CCLES L[/TD]
[TD]ANN[/TD]
[TD="align: right"]15/03/2016[/TD]
[TD="align: right"]18/03/2016[/TD]
[TD="align: right"]29.40[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]CCLES L[/TD]
[TD]PER[/TD]
[TD="align: right"]29/01/2016[/TD]
[TD="align: right"]29/01/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]CCLES L[/TD]
[TD]PER[/TD]
[TD="align: right"]17/02/2016[/TD]
[TD="align: right"]17/02/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]CCLES L[/TD]
[TD]PER[/TD]
[TD="align: right"]31/03/2016[/TD]
[TD="align: right"]01/04/2016[/TD]
[TD="align: right"]14.70[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]KORD R A[/TD]
[TD]ANN[/TD]
[TD="align: right"]08/08/2016[/TD]
[TD="align: right"]19/08/2016[/TD]
[TD="align: right"]18.38[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]KORD R A[/TD]
[TD]ANN[/TD]
[TD="align: right"]08/08/2016[/TD]
[TD="align: right"]19/08/2016[/TD]
[TD="align: right"]55.13[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]KORD R A[/TD]
[TD]ANN[/TD]
[TD="align: right"]13/12/2016[/TD]
[TD="align: right"]14/12/2016[/TD]
[TD="align: right"]14.70[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]KORD R A[/TD]
[TD]PER[/TD]
[TD="align: right"]09/09/2016[/TD]
[TD="align: right"]09/09/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 1[/TD]
[/TR]
[TR]
[TD]KORD R A[/TD]
[TD]PER[/TD]
[TD="align: right"]30/11/2016[/TD]
[TD="align: right"]01/12/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 2[/TD]
[/TR]
[TR]
[TD]KORD R A[/TD]
[TD]PER[/TD]
[TD="align: right"]30/11/2016[/TD]
[TD="align: right"]01/12/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 2[/TD]
[/TR]
[TR]
[TD]KORD R A[/TD]
[TD]PER[/TD]
[TD="align: right"]05/12/2016[/TD]
[TD="align: right"]06/12/2016[/TD]
[TD="align: right"]14.70[/TD]
[TD]Division 2[/TD]
[/TR]
[TR]
[TD]KORD R A[/TD]
[TD]PER[/TD]
[TD="align: right"]15/04/2016[/TD]
[TD="align: right"]15/04/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 2[/TD]
[/TR]
[TR]
[TD]BOLAS R F[/TD]
[TD]ANN[/TD]
[TD="align: right"]14/06/2016[/TD]
[TD="align: right"]14/06/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 2[/TD]
[/TR]
[TR]
[TD]ECCLES J L[/TD]
[TD]ANN[/TD]
[TD="align: right"]30/05/2016[/TD]
[TD="align: right"]30/05/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 2[/TD]
[/TR]
[TR]
[TD]ECCLES J L[/TD]
[TD]PER[/TD]
[TD="align: right"]05/05/2016[/TD]
[TD="align: right"]06/05/2016[/TD]
[TD="align: right"]14.70[/TD]
[TD]Division 2[/TD]
[/TR]
[TR]
[TD]FORD R A[/TD]
[TD]ANN[/TD]
[TD="align: right"]15/12/2016[/TD]
[TD="align: right"]16/12/2016[/TD]
[TD="align: right"]14.70[/TD]
[TD]Division 3[/TD]
[/TR]
[TR]
[TD]FORD R A[/TD]
[TD]ANN[/TD]
[TD="align: right"]03/01/2017[/TD]
[TD="align: right"]13/01/2017[/TD]
[TD="align: right"]54.12[/TD]
[TD]Division 3[/TD]
[/TR]
[TR]
[TD]FORD R A[/TD]
[TD]ANN[/TD]
[TD="align: right"]03/01/2017[/TD]
[TD="align: right"]13/01/2017[/TD]
[TD="align: right"]12.03[/TD]
[TD]Division 3[/TD]
[/TR]
[TR]
[TD]FORD R A[/TD]
[TD]PER[/TD]
[TD="align: right"]25/02/2016[/TD]
[TD="align: right"]26/02/2016[/TD]
[TD="align: right"]14.70[/TD]
[TD]Division 3[/TD]
[/TR]
[TR]
[TD]BINK P H[/TD]
[TD]PER[/TD]
[TD="align: right"]05/12/2016[/TD]
[TD="align: right"]05/12/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 3[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]22/02/2016[/TD]
[TD="align: right"]26/02/2016[/TD]
[TD="align: right"]22.05[/TD]
[TD]Division 3[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]22/02/2016[/TD]
[TD="align: right"]26/02/2016[/TD]
[TD="align: right"]14.70[/TD]
[TD]Division 3[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]02/03/2016[/TD]
[TD="align: right"]02/03/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 3[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]16/03/2016[/TD]
[TD="align: right"]16/03/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 3[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]23/03/2016[/TD]
[TD="align: right"]23/03/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]13/04/2016[/TD]
[TD="align: right"]13/04/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]20/04/2016[/TD]
[TD="align: right"]20/04/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]04/05/2016[/TD]
[TD="align: right"]04/05/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]16/05/2016[/TD]
[TD="align: right"]16/05/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SUTT M[/TD]
[TD]PER[/TD]
[TD="align: right"]23/05/2016[/TD]
[TD="align: right"]23/05/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SON M[/TD]
[TD]ANN[/TD]
[TD="align: right"]29/03/2016[/TD]
[TD="align: right"]11/04/2016[/TD]
[TD="align: right"]37.80[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SON M[/TD]
[TD]ANN[/TD]
[TD="align: right"]29/03/2016[/TD]
[TD="align: right"]11/04/2016[/TD]
[TD="align: right"]21.00[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SON M[/TD]
[TD]ANN[/TD]
[TD="align: right"]12/04/2016[/TD]
[TD="align: right"]20/04/2016[/TD]
[TD="align: right"]44.40[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SON M[/TD]
[TD]ANN[/TD]
[TD="align: right"]21/04/2016[/TD]
[TD="align: right"]21/04/2016[/TD]
[TD="align: right"]6.90[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]SON M[/TD]
[TD]PER[/TD]
[TD="align: right"]04/01/2016[/TD]
[TD="align: right"]04/01/2016[/TD]
[TD="align: right"]7.50[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]VIAN R[/TD]
[TD]ANN[/TD]
[TD="align: right"]12/07/2016[/TD]
[TD="align: right"]18/07/2016[/TD]
[TD="align: right"]10.50[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]VIAN R[/TD]
[TD]ANN[/TD]
[TD="align: right"]12/07/2016[/TD]
[TD="align: right"]18/07/2016[/TD]
[TD="align: right"]26.25[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]VIAN R[/TD]
[TD]PER[/TD]
[TD="align: right"]05/07/2016[/TD]
[TD="align: right"]06/07/2016[/TD]
[TD="align: right"]14.70[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]VIAN R[/TD]
[TD]ANN[/TD]
[TD="align: right"]13/05/2016[/TD]
[TD="align: right"]13/05/2016[/TD]
[TD="align: right"]2.85[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]VIAN R[/TD]
[TD]PER[/TD]
[TD="align: right"]04/02/2016[/TD]
[TD="align: right"]04/02/2016[/TD]
[TD="align: right"]7.35[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]VIAN R[/TD]
[TD]PER[/TD]
[TD="align: right"]01/03/2016[/TD]
[TD="align: right"]01/03/2016[/TD]
[TD="align: right"]2.85[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]VIAN R[/TD]
[TD]PER[/TD]
[TD="align: right"]11/05/2016[/TD]
[TD="align: right"]11/05/2016[/TD]
[TD="align: right"]1.50[/TD]
[TD]Division 4[/TD]
[/TR]
[TR]
[TD]VIAN R[/TD]
[TD]PER[/TD]
[TD="align: right"]02/06/2016[/TD]
[TD="align: right"]03/06/2016[/TD]
[TD="align: right"]14.70[/TD]
[TD]Division 4[/TD]
[/TR]
</tbody>[/TABLE]

What I'm trying to count is: the average number of hrs (Column E) for specific type of leave (ANN or PER), between range of dates , for particular division, and total average for whole divisions.
Hope it's clear.
Thanks for your help.
 
Upvote 0
[...]
What I'm trying to count is: the average number of hrs (Column E) for specific type of leave (ANN or PER), between range of dates , for particular division, and total average for whole divisions.
[...]

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][td]
G​
[/td][td]
H​
[/td][/tr][tr][td]
1​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
2​
[/td][td] BOLAS R F[/td][td] ANN[/td][td]
1/20/2016
[/td][td]
2/8/2016
[/td][td]
38.22
[/td][td] Division 1[/td][td][/td][td]ANN[/td][/tr]
[tr][td]
3​
[/td][td] BOLAS R F[/td][td] ANN[/td][td]
1/20/2016
[/td][td]
2/8/2016
[/td][td]
57.33
[/td][td] Division 1[/td][td][/td][td]PER[/td][/tr]
[tr][td]
4​
[/td][td] BOLAS R F[/td][td] ANN[/td][td]
8/9/2016
[/td][td]
8/9/2016
[/td][td]
7.35
[/td][td] Division 1[/td][td][/td][td]
1/20/2016​
[/td][/tr]
[tr][td]
5​
[/td][td] CCLES L[/td][td] PER[/td][td]
5/27/2016
[/td][td]
5/27/2016
[/td][td]
7.35
[/td][td] Division 1[/td][td][/td][td]
3/1/2016​
[/td][/tr]
[tr][td]
6​
[/td][td] CCLES L[/td][td] ANN[/td][td]
1/22/2016
[/td][td]
1/27/2016
[/td][td]
22.05
[/td][td] Division 1[/td][td][/td][td]division 1[/td][/tr]
[tr][td]
7​
[/td][td] CCLES L[/td][td] ANN[/td][td]
3/1/2016
[/td][td]
3/1/2016
[/td][td]
7.35
[/td][td] Division 1[/td][td][/td][td]
23.275​
[/td][/tr]
[tr][td]
8​
[/td][td] CCLES L[/td][td] ANN[/td][td]
3/15/2016
[/td][td]
3/18/2016
[/td][td]
29.4
[/td][td] Division 1[/td][td][/td][td][/td][/tr]
[tr][td]
9​
[/td][td] CCLES L[/td][td] PER[/td][td]
1/29/2016
[/td][td]
1/29/2016
[/td][td]
7.35
[/td][td] Division 1[/td][td][/td][td][/td][/tr]
[tr][td]
10​
[/td][td] CCLES L[/td][td] PER[/td][td]
2/17/2016
[/td][td]
2/17/2016
[/td][td]
7.35
[/td][td] Division 1[/td][td][/td][td][/td][/tr]
[tr][td]
11​
[/td][td] CCLES L[/td][td] PER[/td][td]
3/31/2016
[/td][td]
4/1/2016
[/td][td]
14.7
[/td][td] Division 1[/td][td][/td][td][/td][/tr]
[/table]


In H7 control+shift+enter, not just enter:

=AVERAGE(IF(ISNUMBER(MATCH($B$2:$B$50,$H$2:$H$3,0)),IF($C$2:$C$50>=H4,IF($D$2:$D$50<=H5,IF($F$2:$F$50=H6,$E$2:$E$50)))))

This is a multiconditional average of hours where one of the conditions is "division 1", a particular division. Care to clarify what you mean by "total average for whole divisions"?
 
Upvote 0

Forum statistics

Threads
1,223,925
Messages
6,175,421
Members
452,640
Latest member
steveridge

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