Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JRD JRD is offline
external usenet poster
 
Posts: 60
Default Discounting duplicates

Is there a way in which I can count cells from particular columns which
contain certain strings but to not count duplicates?

Example

A B
1 Patient number Status
2 1234 Unwell
3 5678 Well
4 9876 Well
5 1234 Unwell
6 9234 Well
7 3456 Unwell

In the above example I want to count the number of unwell patients. However
one of the patients (number 1234 in column A) is duplicated. Therefore, the
number of unwell patients is actually 2, not 3 as would be the answer if I
simply counted the number of unwell entries in column B

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Discounting duplicates

Select the cells in columns A & B and:

Data Filter Advanced Filter specify uniques and put the result in
column C & D

then =COUNTIF(D1:D100,"Unwell")
--
Gary''s Student - gsnu200909


"JRD" wrote:

Is there a way in which I can count cells from particular columns which
contain certain strings but to not count duplicates?

Example

A B
1 Patient number Status
2 1234 Unwell
3 5678 Well
4 9876 Well
5 1234 Unwell
6 9234 Well
7 3456 Unwell

In the above example I want to count the number of unwell patients. However
one of the patients (number 1234 in column A) is duplicated. Therefore, the
number of unwell patients is actually 2, not 3 as would be the answer if I
simply counted the number of unwell entries in column B

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Discounting duplicates

Assuming that the patient numbers really are integer numbers and there are
no empty cells in the patient number column...

Array entered** :

=SUM(IF(FREQUENCY(IF(B2:B7="unwell",A2:A7),A2:A7), 1))

Or, this generic array formula** with the same caveat on empty cells:

=SUM(IF(FREQUENCY(IF(B2:B7="unwell",MATCH(A2:A7,A2 :A7,0)),ROW(A2:A7)-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.

--
Biff
Microsoft Excel MVP


"JRD" wrote in message
...
Is there a way in which I can count cells from particular columns which
contain certain strings but to not count duplicates?

Example

A B
1 Patient number Status
2 1234 Unwell
3 5678 Well
4 9876 Well
5 1234 Unwell
6 9234 Well
7 3456 Unwell

In the above example I want to count the number of unwell patients.
However
one of the patients (number 1234 in column A) is duplicated. Therefore,
the
number of unwell patients is actually 2, not 3 as would be the answer if I
simply counted the number of unwell entries in column B

Thanks




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Condensing a list with duplicates to a list with non-duplicates Nuclear Excel Worksheet Functions 2 July 29th 08 08:03 PM
Duplicates in excel that aren't 100% DUPLICATES ... [email protected] Excel Discussion (Misc queries) 4 May 2nd 08 06:43 PM
Discounting from a table of values NeilB Excel Discussion (Misc queries) 3 December 7th 06 01:47 PM
Mid Period Discounting with the NPV Function apubapu82 Excel Discussion (Misc queries) 5 May 16th 06 04:35 AM
Financial formula for Discounting Cashflows Jeff Excel Discussion (Misc queries) 2 February 15th 05 09:28 PM


All times are GMT +1. The time now is 06:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"