Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
dave roth
 
Posts: n/a
Default Count cells in one range based on parameters in another range

Hi;

I want to count cells in one range on a worksheet that meet certain criteria
("Fatal", "Serious", "Minor", etc.) based on whether they are related to
parameters in another range ("Gunshot", "Stabbing", etc.)

In other words, where an occurrence has Gunshot, I need to count all
occurrences of Fatal. The count serves as input to another cell, which is
then graphed.

I've been doing this by autofiltering, but that's a manual solution, and I
would like to automate the reporting.

I've tried
=COUNTIF(ExtentofInjury_2005,"Fatal")+COUNTIF(Inju ryType1_2005,"Gunshot"),
which of course counts all gunshots and all fatals(trust me, we don't have 24
fatal gunshots). And I know I could do a Pivot table; that's probably the
best solution.

I think I remember this coming up a few years back, but can't remember the
solution.

Tia for your assistance.
  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try something like this:

=SUMPRODUCT(--(A1:A100="Fatal"),--(B1:B100="Gunshot"))

Or use cells to hold the criteria:

C1 = Fatal
D1 = Gunshot

=SUMPRODUCT(--(A1:A100=C1),--(B1:B100=D1))

Biff

-----Original Message-----
Hi;

I want to count cells in one range on a worksheet that

meet certain criteria
("Fatal", "Serious", "Minor", etc.) based on whether they

are related to
parameters in another range ("Gunshot", "Stabbing", etc.)

In other words, where an occurrence has Gunshot, I need

to count all
occurrences of Fatal. The count serves as input to

another cell, which is
then graphed.

I've been doing this by autofiltering, but that's a

manual solution, and I
would like to automate the reporting.

I've tried
=COUNTIF(ExtentofInjury_2005,"Fatal")+COUNTIF

(InjuryType1_2005,"Gunshot"),
which of course counts all gunshots and all fatals(trust

me, we don't have 24
fatal gunshots). And I know I could do a Pivot table;

that's probably the
best solution.

I think I remember this coming up a few years back, but

can't remember the
solution.

Tia for your assistance.
.

  #3   Report Post  
dave roth
 
Posts: n/a
Default

TYVM. The SUMPRODUCT function would not would occirred to me, but I've seen
the answer before; dead brain cells.

"Biff" wrote:

Hi!

Try something like this:

=SUMPRODUCT(--(A1:A100="Fatal"),--(B1:B100="Gunshot"))

Or use cells to hold the criteria:

C1 = Fatal
D1 = Gunshot

=SUMPRODUCT(--(A1:A100=C1),--(B1:B100=D1))

Biff

-----Original Message-----
Hi;

I want to count cells in one range on a worksheet that

meet certain criteria
("Fatal", "Serious", "Minor", etc.) based on whether they

are related to
parameters in another range ("Gunshot", "Stabbing", etc.)

In other words, where an occurrence has Gunshot, I need

to count all
occurrences of Fatal. The count serves as input to

another cell, which is
then graphed.

I've been doing this by autofiltering, but that's a

manual solution, and I
would like to automate the reporting.

I've tried
=COUNTIF(ExtentofInjury_2005,"Fatal")+COUNTIF

(InjuryType1_2005,"Gunshot"),
which of course counts all gunshots and all fatals(trust

me, we don't have 24
fatal gunshots). And I know I could do a Pivot table;

that's probably the
best solution.

I think I remember this coming up a few years back, but

can't remember the
solution.

Tia for your assistance.
.


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
Adding colour to a range of cells based on one of the cells v... McKenna Excel Discussion (Misc queries) 4 March 11th 05 02:25 PM
Formula to count the cells in a range that have a fill color. Slainteva Excel Discussion (Misc queries) 2 January 19th 05 08:25 PM
Formula to count the cells in a range that have a fill color. Molly F Excel Discussion (Misc queries) 2 January 19th 05 06:15 PM
I need to count the occurence of text in a range of cells (which . Brenda Excel Worksheet Functions 1 December 12th 04 09:00 PM
I have a list of dates that I need to count based on a date range ejb030353 Excel Worksheet Functions 4 November 24th 04 02:27 PM


All times are GMT +1. The time now is 06:28 AM.

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"