Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default how to count a column based on condition of another column

Column E: class of doctors. Includes A,B,C
Column L: residing city of doctors

I want to count number of doctors with class A in a specified city.
I thought the following formula will work:
IF(L10:L93="Tabriz",COUNTIF(E10:E93,"A"),) but it didn't.
Basically I am looking for a foormula to count a cloumn when a condition is
met in another column.
How can I write this formula?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 176
Default how to count a column based on condition of another column

=SUMPRODUCT(--(L10:L93="Tabriz"),--(E10:E93="A"))

--
Regards,
Dave


"R Khoshravan" wrote:

Column E: class of doctors. Includes A,B,C
Column L: residing city of doctors

I want to count number of doctors with class A in a specified city.
I thought the following formula will work:
IF(L10:L93="Tabriz",COUNTIF(E10:E93,"A"),) but it didn't.
Basically I am looking for a foormula to count a cloumn when a condition is
met in another column.
How can I write this formula?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 341
Default how to count a column based on condition of another column

Hi David,

This is something I need to learn.
Why does it work with the --?
Isn't that like a double negative? Why doesn't it work without it?
Where can I find out more about this?

thanks for your help
--
Allllen


"David Billigmeier" wrote:

=SUMPRODUCT(--(L10:L93="Tabriz"),--(E10:E93="A"))

--
Regards,
Dave


"R Khoshravan" wrote:

Column E: class of doctors. Includes A,B,C
Column L: residing city of doctors

I want to count number of doctors with class A in a specified city.
I thought the following formula will work:
IF(L10:L93="Tabriz",COUNTIF(E10:E93,"A"),) but it didn't.
Basically I am looking for a foormula to count a cloumn when a condition is
met in another column.
How can I write this formula?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 176
Default how to count a column based on condition of another column

The double negative converts TRUE/FALSE to 1/0. The reason it doesn't work
without them is Excel doesn't understand a summation of TRUE's and FALSE's.
You can also achieve this by doing any kind of mathematical computation to
the ranges, for example both of these will work as well:

=SUMPRODUCT(1*(L10:L93="Tabriz"),1*(E10:E93="A"))
=SUMPRODUCT((L10:L93="Tabriz")*(E10:E93="A"))

You can learn more about SUMPRODUCT() he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html


--
Regards,
Dave


"Allllen" wrote:

Hi David,

This is something I need to learn.
Why does it work with the --?
Isn't that like a double negative? Why doesn't it work without it?
Where can I find out more about this?

thanks for your help
--
Allllen


"David Billigmeier" wrote:

=SUMPRODUCT(--(L10:L93="Tabriz"),--(E10:E93="A"))

--
Regards,
Dave


"R Khoshravan" wrote:

Column E: class of doctors. Includes A,B,C
Column L: residing city of doctors

I want to count number of doctors with class A in a specified city.
I thought the following formula will work:
IF(L10:L93="Tabriz",COUNTIF(E10:E93,"A"),) but it didn't.
Basically I am looking for a foormula to count a cloumn when a condition is
met in another column.
How can I write this formula?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 341
Default how to count a column based on condition of another column

Brilliant. Thanks very much.
--
Allllen


"David Billigmeier" wrote:

The double negative converts TRUE/FALSE to 1/0. The reason it doesn't work
without them is Excel doesn't understand a summation of TRUE's and FALSE's.
You can also achieve this by doing any kind of mathematical computation to
the ranges, for example both of these will work as well:

=SUMPRODUCT(1*(L10:L93="Tabriz"),1*(E10:E93="A"))
=SUMPRODUCT((L10:L93="Tabriz")*(E10:E93="A"))

You can learn more about SUMPRODUCT() he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html


--
Regards,
Dave


"Allllen" wrote:

Hi David,

This is something I need to learn.
Why does it work with the --?
Isn't that like a double negative? Why doesn't it work without it?
Where can I find out more about this?

thanks for your help
--
Allllen


"David Billigmeier" wrote:

=SUMPRODUCT(--(L10:L93="Tabriz"),--(E10:E93="A"))

--
Regards,
Dave


"R Khoshravan" wrote:

Column E: class of doctors. Includes A,B,C
Column L: residing city of doctors

I want to count number of doctors with class A in a specified city.
I thought the following formula will work:
IF(L10:L93="Tabriz",COUNTIF(E10:E93,"A"),) but it didn't.
Basically I am looking for a foormula to count a cloumn when a condition is
met in another column.
How can I write this formula?

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
I need to count data in one colum based on data in another column LG Excel Worksheet Functions 1 June 13th 06 02:41 PM
count values in one column based on their realtionship with anoth. shopaholic Excel Worksheet Functions 1 December 9th 05 01:13 AM
Count Intervals of 1 Numeric value in a Row and Return Count down Column Sam via OfficeKB.com Excel Worksheet Functions 8 October 4th 05 04:37 PM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 8 May 18th 05 04:23 AM
How do I hide a column based on a condition (option not available. jgentillet Excel Worksheet Functions 0 January 24th 05 02:53 PM


All times are GMT +1. The time now is 10:04 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"