#1   Report Post  
Posted to microsoft.public.excel.misc
Thank you, Heath
 
Posts: n/a
Default countif


How do you code the following situation:

countif(AND, logic1, logic2, logic3)

meaning I want it to count all of the occurances within three different
coloums of data.
Example: If Sally has a Doctors appointment in March, or If Mark has a
Tennis appointment in June, or if Bob has a dentist appointment in August. So
I want to be able to ask, how many doctors appointments does Sally have in
May? Or how many dentist appointments does Bob have in July.
  #3   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default countif

Use SUMPRODUCT:

=SUMPRODUCT(--(range1=cond1),--(range2=cond2),--(range3=cond3))

Ranges must be same dimensions i.e rows/columns

e.g

=SUMPRODUCT(--(A1:A100="Sally"),--(B1:B100="Dentist"),--(C1:C100=<Date))

<Date is month etc.

HTH

"Thank you, Heath" wrote:


How do you code the following situation:

countif(AND, logic1, logic2, logic3)

meaning I want it to count all of the occurances within three different
coloums of data.
Example: If Sally has a Doctors appointment in March, or If Mark has a
Tennis appointment in June, or if Bob has a dentist appointment in August. So
I want to be able to ask, how many doctors appointments does Sally have in
May? Or how many dentist appointments does Bob have in July.

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default countif

=sumproduct(--(a1:a10="sally"),--(text(b1:b10,"yyyymm")="200605"))

Will count the Appointments in May of 2006 by Sally.

Adjust the ranges to match--but you can't use whole columns.

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail he
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

===========
If you have lots of these to summarize, you may want to look at using a
pivottable.

If you want to read more about pivottables...

Here are a few links:

Debra Dalgleish's pictures at Jon Peltier's site:
http://peltiertech.com/Excel/Pivots/pivottables.htm
And Debra's own site:
http://www.contextures.com/xlPivot01.html

John Walkenbach also has some at:
http://j-walk.com/ss/excel/files/general.htm
(look for Tony Gwynn's Hit Database)

Chip Pearson keeps Harald Staff's notes at:
http://www.cpearson.com/excel/pivots.htm

MS has some at (xl2000 and xl2002):
http://office.microsoft.com/downloads/2000/XCrtPiv.aspx
http://office.microsoft.com/assistan...lconPT101.aspx

Thank you, Heath wrote:

How do you code the following situation:

countif(AND, logic1, logic2, logic3)

meaning I want it to count all of the occurances within three different
coloums of data.
Example: If Sally has a Doctors appointment in March, or If Mark has a
Tennis appointment in June, or if Bob has a dentist appointment in August. So
I want to be able to ask, how many doctors appointments does Sally have in
May? Or how many dentist appointments does Bob have in July.


--

Dave Peterson
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
Countif Formula /Sort Bug??? orcfodder Excel Discussion (Misc queries) 2 January 12th 06 10:04 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
Combining IF and COUNTIF based on two columns maxtrixx Excel Discussion (Misc queries) 5 March 31st 05 06:21 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM
countif, again Liz G Excel Worksheet Functions 2 November 1st 04 11:20 PM


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

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"