Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 56
Default Compound CountIf formula

Good afternoon,
I have a database where column A contains one of three values, A, B or C,
and Column J contains a status indicator "Y" or "N"

I want to write formulae that display counts of all rows where Col A = "A"
and Col J = "Y", where Col A = "B" and Col J = Y" and where Col A = "C" and
Col J = "Y".
Is there a quick way to do this using COUNTIF without having to set up a
criteria range and doing it with DSUM?

Thanks in advance

Pete
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 141
Default Compound CountIf formula

On Apr 16, 10:42*pm, Pete Rooney
wrote:
Good afternoon,
I have a database where column A contains one of three values, A, B or C,
and Column J contains a status indicator "Y" or "N"

I want to write formulae that display counts of all rows where Col A = "A"
and Col J = "Y", where Col A = "B" and Col J = Y" and where Col A = "C" and
Col J = "Y".
Is there a quick way to do this using COUNTIF without having to set up a
criteria range and doing it with DSUM?

Thanks in advance

Pete


Hi Pete,

If you could handle having a 'helper' column, you could put the
following formula in say column L:

=OR(AND(A1="A",J1="Y"),AND(A1="B",J1="Y"),AND(A1=" C",J1="Y"))

Then just do your COUNTIF on column L with a criteria of TRUE.

Cheers,
Ivan.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Compound CountIf formula

=COUNTIF(J:J,"Y")

"Pete Rooney" wrote:

Good afternoon,
I have a database where column A contains one of three values, A, B or C,
and Column J contains a status indicator "Y" or "N"

I want to write formulae that display counts of all rows where Col A = "A"
and Col J = "Y", where Col A = "B" and Col J = Y" and where Col A = "C" and
Col J = "Y".
Is there a quick way to do this using COUNTIF without having to set up a
criteria range and doing it with DSUM?

Thanks in advance

Pete

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Compound CountIf formula

If you're using xl2007, look at =countifs() in Excel's help.

In any version...

=sumproduct(--(a1:a10="a"),--(j1:j10="Y"))

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=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

=========

You may want to consider using a pivottable.
You can a row of headers to all the columns (if you don't have them).

Then (in xl2003 menus):
Data|Pivottable
follow the wizard until you get to a dialog with Layout on it.
Click that Layout button
Drag the header for ColA into the row field.
Drag the header for ColJ into the column field.
Then drag the header for ColJ (a second time!) into the Data field).
(It should say "Count of..." in the data field.)

Then finish up the wizard.

If you've never used 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



Pete Rooney wrote:

Good afternoon,
I have a database where column A contains one of three values, A, B or C,
and Column J contains a status indicator "Y" or "N"

I want to write formulae that display counts of all rows where Col A = "A"
and Col J = "Y", where Col A = "B" and Col J = Y" and where Col A = "C" and
Col J = "Y".
Is there a quick way to do this using COUNTIF without having to set up a
criteria range and doing it with DSUM?

Thanks in advance

Pete


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 56
Default Compound CountIf formula

Dave,

This works just fine - I had lots of SUMPRODUCT examples, just not one to do
this. You've just been responsible for the death of a worksheet full of
criteria ranges - I hope you can live with yourself! :-)

Thanks

Pete




"Dave Peterson" wrote:

If you're using xl2007, look at =countifs() in Excel's help.

In any version...

=sumproduct(--(a1:a10="a"),--(j1:j10="Y"))

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=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

=========

You may want to consider using a pivottable.
You can a row of headers to all the columns (if you don't have them).

Then (in xl2003 menus):
Data|Pivottable
follow the wizard until you get to a dialog with Layout on it.
Click that Layout button
Drag the header for ColA into the row field.
Drag the header for ColJ into the column field.
Then drag the header for ColJ (a second time!) into the Data field).
(It should say "Count of..." in the data field.)

Then finish up the wizard.

If you've never used 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



Pete Rooney wrote:

Good afternoon,
I have a database where column A contains one of three values, A, B or C,
and Column J contains a status indicator "Y" or "N"

I want to write formulae that display counts of all rows where Col A = "A"
and Col J = "Y", where Col A = "B" and Col J = Y" and where Col A = "C" and
Col J = "Y".
Is there a quick way to do this using COUNTIF without having to set up a
criteria range and doing it with DSUM?

Thanks in advance

Pete


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Compound CountIf formula

Before you celebrate too much, you may want to try the pivottable.

I bet with lots and lots of these =sumproduct() formulas (and lots and lots of
rows to check), the calculation time can slow downnnnnnnnnnnn.



Pete Rooney wrote:

Dave,

This works just fine - I had lots of SUMPRODUCT examples, just not one to do
this. You've just been responsible for the death of a worksheet full of
criteria ranges - I hope you can live with yourself! :-)

Thanks

Pete

"Dave Peterson" wrote:

If you're using xl2007, look at =countifs() in Excel's help.

In any version...

=sumproduct(--(a1:a10="a"),--(j1:j10="Y"))

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=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

=========

You may want to consider using a pivottable.
You can a row of headers to all the columns (if you don't have them).

Then (in xl2003 menus):
Data|Pivottable
follow the wizard until you get to a dialog with Layout on it.
Click that Layout button
Drag the header for ColA into the row field.
Drag the header for ColJ into the column field.
Then drag the header for ColJ (a second time!) into the Data field).
(It should say "Count of..." in the data field.)

Then finish up the wizard.

If you've never used 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



Pete Rooney wrote:

Good afternoon,
I have a database where column A contains one of three values, A, B or C,
and Column J contains a status indicator "Y" or "N"

I want to write formulae that display counts of all rows where Col A = "A"
and Col J = "Y", where Col A = "B" and Col J = Y" and where Col A = "C" and
Col J = "Y".
Is there a quick way to do this using COUNTIF without having to set up a
criteria range and doing it with DSUM?

Thanks in advance

Pete


--

Dave Peterson


--

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
Formula-Compound Sales Forecast GatorGirl Excel Discussion (Misc queries) 4 March 6th 07 05:04 PM
Compound condition with COUNTIF Mike McLellan Excel Discussion (Misc queries) 1 November 29th 05 10:50 AM
compound interest formula Ciara Excel Discussion (Misc queries) 3 June 8th 05 09:57 AM
COUNTIF with compound comparison Thermometer Excel Worksheet Functions 1 March 28th 05 04:15 PM
What formula can you use to compound monthly returns? Legan002 Excel Worksheet Functions 1 November 18th 04 06:47 PM


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