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 Another counting question!

I need to be able to count the number of cells in a column containing certain
text words, but only if cells in the same row in 2 other columns contain
certain text

I have put an example below:

A B C
High Invalid Death
Very Low Invalid MI
Low Valid CVA
Low Invalid No Complications
Low Valid No Complications
Very Low Valid MI, Death
Very Low Invalid No Complications
Low Valid Emergency CABG
Very Low Invalid No Complications
Very Low Invalid Death
Low Invalid Death
Very Low Invalid CVA, Death

So, I need to count the number of cells in column C that contain either
"Death", "CVA", "MI", or "Emergency CABG" or any combination the 4, but only
if the cell in the same row in column A = "Low" and the cell in the same row
in column B = "Valid". Therefore the answer here would be 2 (3rd and 8th
rows).

Is this possible?

Thanks

John
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Another counting question!

One way:
=SUMPRODUCT((ISNUMBER(MATCH($C$1:$C$12,{"Death";"M I";"CVA";"Emergency
CABG"},0)))*($A$1:$A$12="Low")*($B$1:$B$12="Valid" ))
Adapt the ranges to suit
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"JRD" wrote:
I need to be able to count the number of cells in a column containing certain
text words, but only if cells in the same row in 2 other columns contain
certain text

I have put an example below:

A B C
High Invalid Death
Very Low Invalid MI
Low Valid CVA
Low Invalid No Complications
Low Valid No Complications
Very Low Valid MI, Death
Very Low Invalid No Complications
Low Valid Emergency CABG
Very Low Invalid No Complications
Very Low Invalid Death
Low Invalid Death
Very Low Invalid CVA, Death

So, I need to count the number of cells in column C that contain either
"Death", "CVA", "MI", or "Emergency CABG" or any combination the 4, but only
if the cell in the same row in column A = "Low" and the cell in the same row
in column B = "Valid". Therefore the answer here would be 2 (3rd and 8th
rows).

Is this possible?

Thanks

John

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Another counting question!

One way:

=SUMPRODUCT(--(A1:A12="Low"), --(B1:B12="Valid"),
--(ISNUMBER(SEARCH("CVA",C1:C12)) + ISNUMBER(SEARCH("MI",C1:C12)) +
ISNUMBER(SEARCH("Death",C1:C12)) + ISNUMBER(SEARCH("Emergency
CABG",C1:C12)) 0))

Given your data set, it would be simpler to use

=SUMPRODUCT(--(A1:A12="Low"), --(B1:B12="Valid"), --(C1:C12<"No
Complications"))

In article ,
JRD wrote:

I need to be able to count the number of cells in a column containing certain
text words, but only if cells in the same row in 2 other columns contain
certain text

I have put an example below:

A B C
High Invalid Death
Very Low Invalid MI
Low Valid CVA
Low Invalid No Complications
Low Valid No Complications
Very Low Valid MI, Death
Very Low Invalid No Complications
Low Valid Emergency CABG
Very Low Invalid No Complications
Very Low Invalid Death
Low Invalid Death
Very Low Invalid CVA, Death

So, I need to count the number of cells in column C that contain either
"Death", "CVA", "MI", or "Emergency CABG" or any combination the 4, but only
if the cell in the same row in column A = "Low" and the cell in the same row
in column B = "Valid". Therefore the answer here would be 2 (3rd and 8th
rows).

Is this possible?

Thanks

John

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Another counting question!

Note that this will not meet the "or any combination of the 4" criterion.


In article ,
Max wrote:

One way:
=SUMPRODUCT((ISNUMBER(MATCH($C$1:$C$12,{"Death";"M I";"CVA";"Emergency
CABG"},0)))*($A$1:$A$12="Low")*($B$1:$B$12="Valid" ))
Adapt the ranges to suit
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"JRD" wrote:
I need to be able to count the number of cells in a column containing
certain
text words, but only if cells in the same row in 2 other columns contain
certain text

I have put an example below:

A B C
High Invalid Death
Very Low Invalid MI
Low Valid CVA
Low Invalid No Complications
Low Valid No Complications
Very Low Valid MI, Death
Very Low Invalid No Complications
Low Valid Emergency CABG
Very Low Invalid No Complications
Very Low Invalid Death
Low Invalid Death
Very Low Invalid CVA, Death

So, I need to count the number of cells in column C that contain either
"Death", "CVA", "MI", or "Emergency CABG" or any combination the 4, but
only
if the cell in the same row in column A = "Low" and the cell in the same
row
in column B = "Valid". Therefore the answer here would be 2 (3rd and 8th
rows).

Is this possible?

Thanks

John

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Another counting question!

"JE McGimpsey" wrote
Note that this will not meet the "or any combination of the 4" criterion.


My oversight there.
Pl dismiss the suggestion.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


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
Counting Question ingalla Excel Discussion (Misc queries) 3 June 2nd 06 05:09 PM
Counting question Brad Excel Worksheet Functions 1 May 8th 06 05:55 PM
Counting question ckiraly Excel Worksheet Functions 6 July 11th 05 03:45 PM
Counting Question Metalteck Excel Discussion (Misc queries) 1 June 21st 05 09:01 PM
Counting question sjs Excel Discussion (Misc queries) 5 December 2nd 04 09:24 AM


All times are GMT +1. The time now is 05:56 PM.

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

About Us

"It's about Microsoft Excel"