easy one - Counting values

Marcus

New Member
Joined
Mar 21, 2002
Messages
37
Hi,

Should be an easy one, I have a sheet with 64000 items of kit listed against a couple of hundred different contract numbers. Currently in the format:

contract1 kit1
contract1 kit2
contract1 kit3
contract1 kit4
contract2 kit5
contract2 kit6
contract3 kit7
contract3 kit8
contract3 kit9

i.e. this would be 3 contracts, with 4, 2 and 3 items of kit against them. So the question is, how do I count the contract numbers?

Any help would be much appreciated.
Cheers,
Marcus
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Try Data>Sub Totals

At each change in contract number, count kits
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
64000 cells... that's a lot.

The best thing to do is to use the morefunc.xll add-in's COUNTDIFF function...

=COUNTDIFF(Range)

where Range houses the contract numbers. One caveat though: The Range should not have formula generated "" (blanks), while empty cells are OK.

Otherwise, array-enter...

=SUM(IF(LEN(Range),1/COUNTIF(Range,Range)))

To array-enter a formula, you need to hit control+shift+enter at the same time, not just enter.

The above formulas produce a count of distinct contract numbers.
 

Forum statistics

Threads
1,144,735
Messages
5,725,986
Members
422,652
Latest member
Elnene1

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
Top