Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Using "COUNTIF" and "AND" functions together

I have an array of stores in various geographies and am trying to count the
number of stores in a particular "Market" that also have "Restrooms". I'm
essentially trying to get a count of how many stores in each "market" have
"restrooms". For instance, I have 250 stores, 5 of which are in Atlanta and
among those 5, only 2 have Restrooms. I'd like to use this function for
every geography so that next to my 20 geography's I can include a column that
shows how many "restrooms" in each geography.. Any help would be greatly
appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Using "COUNTIF" and "AND" functions together

Try
=SUMPRODUCT(--(A2:A10="geography"),--(B2:B10="restroom"))

If this post helps click Yes
---------------
Jacob Skaria


"trevor" wrote:

I have an array of stores in various geographies and am trying to count the
number of stores in a particular "Market" that also have "Restrooms". I'm
essentially trying to get a count of how many stores in each "market" have
"restrooms". For instance, I have 250 stores, 5 of which are in Atlanta and
among those 5, only 2 have Restrooms. I'd like to use this function for
every geography so that next to my 20 geography's I can include a column that
shows how many "restrooms" in each geography.. Any help would be greatly
appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Using "COUNTIF" and "AND" functions together

Jacob,
A couple of questions:
1) what does the "--" do? I've never used them before in a function
2) if I want to reference a cell with "Atlanta" in the Geography column
instead of typing "Atlanta" does the formula change?
thanks a ton

"Jacob Skaria" wrote:

Try
=SUMPRODUCT(--(A2:A10="geography"),--(B2:B10="restroom"))

If this post helps click Yes
---------------
Jacob Skaria


"trevor" wrote:

I have an array of stores in various geographies and am trying to count the
number of stores in a particular "Market" that also have "Restrooms". I'm
essentially trying to get a count of how many stores in each "market" have
"restrooms". For instance, I have 250 stores, 5 of which are in Atlanta and
among those 5, only 2 have Restrooms. I'd like to use this function for
every geography so that next to my 20 geography's I can include a column that
shows how many "restrooms" in each geography.. Any help would be greatly
appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Using "COUNTIF" and "AND" functions together

Hi Trevor

1) -- converts boolean TRUE/FALSE to 1 and 0...for the sumproduct..You can
find an explanasion here http://mcgimpsey.com/excel/formulae/doubleneg.html
You can also use

=SUMPRODUCT((A2:A10="geography")*(B2:B10="restroom "))

2) You can reference to a cell with the query fields in C1. The array rows
needs to be same for Col A and Col B...So you can have a list of geographies
and beside you can place the formula and copy down as required...

=SUMPRODUCT(($A$2:$A$100=C1)*($B$2:$B$100="restroo m"))

If this post helps click Yes
---------------
Jacob Skaria


"trevor" wrote:

Jacob,
A couple of questions:
1) what does the "--" do? I've never used them before in a function
2) if I want to reference a cell with "Atlanta" in the Geography column
instead of typing "Atlanta" does the formula change?
thanks a ton

"Jacob Skaria" wrote:

Try
=SUMPRODUCT(--(A2:A10="geography"),--(B2:B10="restroom"))

If this post helps click Yes
---------------
Jacob Skaria


"trevor" wrote:

I have an array of stores in various geographies and am trying to count the
number of stores in a particular "Market" that also have "Restrooms". I'm
essentially trying to get a count of how many stores in each "market" have
"restrooms". For instance, I have 250 stores, 5 of which are in Atlanta and
among those 5, only 2 have Restrooms. I'd like to use this function for
every geography so that next to my 20 geography's I can include a column that
shows how many "restrooms" in each geography.. Any help would be greatly
appreciated.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Using "COUNTIF" and "AND" functions together

great... the second option without the "--" works. I'll have to read about
the "--". this second option only works if I change the cell from "Yes" in
the restroom column to "1" for restroom, "0" for no restroom. I'm guessing
the "--" may help solve that? would I need to download a toolpak to make the
"--" work?
thanks again!

"Jacob Skaria" wrote:

Hi Trevor

1) -- converts boolean TRUE/FALSE to 1 and 0...for the sumproduct..You can
find an explanasion here http://mcgimpsey.com/excel/formulae/doubleneg.html
You can also use

=SUMPRODUCT((A2:A10="geography")*(B2:B10="restroom "))

2) You can reference to a cell with the query fields in C1. The array rows
needs to be same for Col A and Col B...So you can have a list of geographies
and beside you can place the formula and copy down as required...

=SUMPRODUCT(($A$2:$A$100=C1)*($B$2:$B$100="restroo m"))

If this post helps click Yes
---------------
Jacob Skaria


"trevor" wrote:

Jacob,
A couple of questions:
1) what does the "--" do? I've never used them before in a function
2) if I want to reference a cell with "Atlanta" in the Geography column
instead of typing "Atlanta" does the formula change?
thanks a ton

"Jacob Skaria" wrote:

Try
=SUMPRODUCT(--(A2:A10="geography"),--(B2:B10="restroom"))

If this post helps click Yes
---------------
Jacob Skaria


"trevor" wrote:

I have an array of stores in various geographies and am trying to count the
number of stores in a particular "Market" that also have "Restrooms". I'm
essentially trying to get a count of how many stores in each "market" have
"restrooms". For instance, I have 250 stores, 5 of which are in Atlanta and
among those 5, only 2 have Restrooms. I'd like to use this function for
every geography so that next to my 20 geography's I can include a column that
shows how many "restrooms" in each geography.. Any help would be greatly
appreciated.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Using "COUNTIF" and "AND" functions together

See this:

http://xldynamic.com/source/xld.SUMPRODUCT.html

--
Biff
Microsoft Excel MVP


"trevor" wrote in message
...
great... the second option without the "--" works. I'll have to read
about
the "--". this second option only works if I change the cell from "Yes"
in
the restroom column to "1" for restroom, "0" for no restroom. I'm guessing
the "--" may help solve that? would I need to download a toolpak to make
the
"--" work?
thanks again!

"Jacob Skaria" wrote:

Hi Trevor

1) -- converts boolean TRUE/FALSE to 1 and 0...for the sumproduct..You
can
find an explanasion here
http://mcgimpsey.com/excel/formulae/doubleneg.html
You can also use

=SUMPRODUCT((A2:A10="geography")*(B2:B10="restroom "))

2) You can reference to a cell with the query fields in C1. The array
rows
needs to be same for Col A and Col B...So you can have a list of
geographies
and beside you can place the formula and copy down as required...

=SUMPRODUCT(($A$2:$A$100=C1)*($B$2:$B$100="restroo m"))

If this post helps click Yes
---------------
Jacob Skaria


"trevor" wrote:

Jacob,
A couple of questions:
1) what does the "--" do? I've never used them before in a function
2) if I want to reference a cell with "Atlanta" in the Geography column
instead of typing "Atlanta" does the formula change?
thanks a ton

"Jacob Skaria" wrote:

Try
=SUMPRODUCT(--(A2:A10="geography"),--(B2:B10="restroom"))

If this post helps click Yes
---------------
Jacob Skaria


"trevor" wrote:

I have an array of stores in various geographies and am trying to
count the
number of stores in a particular "Market" that also have
"Restrooms". I'm
essentially trying to get a count of how many stores in each
"market" have
"restrooms". For instance, I have 250 stores, 5 of which are in
Atlanta and
among those 5, only 2 have Restrooms. I'd like to use this
function for
every geography so that next to my 20 geography's I can include a
column that
shows how many "restrooms" in each geography.. Any help would be
greatly
appreciated.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Using "COUNTIF" and "AND" functions together

Hi,

You may also use a pivot table. Drag the stores column to the row area,
drag the restrooms column to the data area. If you get the sum instead of
the count, then right cluck, select value field settings and select count

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"trevor" wrote in message
...
I have an array of stores in various geographies and am trying to count
the
number of stores in a particular "Market" that also have "Restrooms". I'm
essentially trying to get a count of how many stores in each "market" have
"restrooms". For instance, I have 250 stores, 5 of which are in Atlanta
and
among those 5, only 2 have Restrooms. I'd like to use this function for
every geography so that next to my 20 geography's I can include a column
that
shows how many "restrooms" in each geography.. Any help would be greatly
appreciated.


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
Difficulty "countif"-ing number of "L1" or "L2" on an autofiltered pmdoherty Excel Worksheet Functions 4 February 6th 09 11:23 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
can I nest COUNTIF functions(C5:C8,"apples") AND (D5:D8,"green") guycummins Excel Worksheet Functions 4 June 10th 08 09:23 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


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