# Help requested for analysing batches

##### New Member
Can anyone advise an easy way to analyse the number of "groups" or batches, min batch size, max batch size and average batch size? For example, if you were counting widgets going past you, in colour a, b or c.

Sequence Col Col Col
# a b c
----------------------------
1 a
2 b
3 a
4 a
5 a
6 b
7 b
8 c
9 a
10 a
11 b
12 b
13 c
14 a
15 c

Analysis:
Colour a b c
No of items 7 5 3
No Batches 4 3 3
Ave Batch Size 1.75 1.66 1
Min Batch Size 1 1 1
Max Batch Size 3 2 1

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Welcome to the Forum!

Try this:

B18: =COUNTIF(\$B1:\$B15,B17)
B19: =SUMPRODUCT(--(\$B1:\$B15=B17),--(\$B2:\$B16<>B17))
B20: =IFERROR(B18/B19,"N/A")
B21: {=MIN(IF(FREQUENCY(IF(\$B1:\$B15=B17,ROW(\$B1:\$B15)), IF(1-(\$B1:\$B15=B17),ROW(\$B1:\$B15))),
FREQUENCY(IF(\$B1:\$B15=B17,ROW(\$B1:\$B15)),IF(1-(\$B1:\$B15=B17),
ROW(\$B1:\$B15)))))} Array-entered
B22: {=MAX(FREQUENCY(IF(\$B1:\$B15=B17,ROW(\$B1:\$B15)),IF(\$B1:\$B15<>B17,ROW(\$B1:\$B15))))} Array-entered

Excel 2010
ABCD
11a
22b
33a
44a
55a
66b
77b
88c
99a
1010a
1111b
1212b
1313c
1414a
1515c
16
17abc
18Number753
19Batches433
20Av Batch1.751.671.00
21Min Batch111
22Max Batch321

</tbody>

StephenCrump: Absolutely perfect (and very neat). Many thanks.

You're welcome. Thanks for the feedback.

Replies
19
Views
691
Replies
6
Views
433
Replies
1
Views
458
Replies
9
Views
324
Replies
2
Views
212

1,217,385
Messages
6,136,277
Members
450,001
Latest member
KWeekley08

### 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?

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