counting names

simoncjohn

New Member
Joined
May 23, 2011
Messages
1
:confused:Hi there, i am doing a piece of work (18000+ lines) trying to ascertain a value that relates to staff numbers...

I have an extract of data that includes names, payrefs, organisation and other data surrounding payments made to staff (i.e, First Aid, Night Duty etc) - each line is unique in a sense that it relates to a type of payment made, what i am needing to calculate is the total number of staff per organisation that are in receipt of a payment (FYI member of staff may have had 20 payments - i am only wanting to show the value 1 and not 20 so that they could be counted and placed into a pivot table). I have tried various Ifcount and pivot table options to no avail. can you help please?

regards, Simon.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Use :

=SUMPRODUCT(1/COUNTIF(A:A,A:A))

replace A:A with the range for the names. This would give you a count of the unique names.

Sanjeev
 
Upvote 0
Sanjeev - interesting formula, but I don't understand exactly how it works. Can you explain please ?

Also, it return as #DIV/0! error if there are blanks. Is there a neat way round that ?
 
Upvote 0
:confused:Hi there, i am doing a piece of work (18000+ lines) trying to ascertain a value that relates to staff numbers...

I have an extract of data that includes names, payrefs, organisation and other data surrounding payments made to staff (i.e, First Aid, Night Duty etc) - each line is unique in a sense that it relates to a type of payment made, what i am needing to calculate is the total number of staff per organisation that are in receipt of a payment (FYI member of staff may have had 20 payments - i am only wanting to show the value 1 and not 20 so that they could be counted and placed into a pivot table). I have tried various Ifcount and pivot table options to no avail. can you help please?

regards, Simon.
With 18k rows of data any formula will be kind of slow to calculate. Some will be slower than others.

Try this:

Book1
A
2Name1
3Name10
4Name10
5Name2
6Name2
7Name2
8Name3
9Name4
10Name4
11Name5
12Name5
13Name6
14Name6
15Name7
16Name7
17Name7
18Name7
19Name9
20Name9
Sheet2

Array entered**:

=SUM(IF(FREQUENCY(MATCH(A2:A20,A2:A20,0),ROW(A2:A20)-ROW(A2)+1),1))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

Assumes no empty cells within the range.
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

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