Excel - my head hurts

Associate
Joined
21 Feb 2009
Posts
187
Location
Newcastle upon Tyne
Sorry, another excel thread, but I'm just going round in circles trying to work out how to do something.

My worksheet contains details of invoices raised to pay suppliers in the last 12 months. Each line has the Supplier Name, Department to which the services were supplied and other related data. There are around 500,000 lines of data. I'm trying to determine for each Supplier the number of Departments they have supplied.

So using the example data below:

Line1. Supplier A, DepartmentZ
Line2. Supplier A, DepartmentY
Line3. Supplier A, DepartmentY
Line4. Supplier B, DepartmentZ
Line5. Supplier B, DepartmentZ

I would get:

Supplier A - 2
Supplier B - 1

The way I thought to approach it was to count unique text values (Departments) grouped by Supplier but even with the powers of Google I'm struggling to work out the principle let alone the formula to do it.

Any help will be gratefully accepted.
 
As FTM says a pivot table is probably the simplest way to do this. You can use filters to get lists of data so you'd see how many of each supplier or department there are but a pivot table makes more sense and is more powerful.
 
Cheers - I started off that way but the pivot was showing total number of departments rather than unique numbers - so in my example it would show Supplier A - 3 and Supplier B - 2. I'll have another look as I don't use pivots that often so am a bit rusty.
 
Pivot table. Drag Supplier into the Rows area and Department below it, then drag Department again from the fields list into Values. Each Department will be given 1 and the subtotal against each Supplier will show you how many Departments they serve.
 
If you don't want to pivot, I think COUNTIFS formulae should be able to give you what you want too. It's just like a COUNTIF but with multiple criteria, so you can count how many lines have both a 'z' in row A and a 'b' in row B.
 
Pivot seems a straight forward and powerful way to tackle this. However I agree with FTM and this should belong in access (once you get tons of records - 500,000!!!) and it can do pivot tables too..
 
Back
Top Bottom