#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 447
Default COUNTIF

Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default COUNTIF

And these are the words Red and Blue--not the actual colors, right?

=sum(countif(a1:a25,{"Red","Blue"}))

or you could each separately:

=countif(a1:a25,"Red") + countif(a1:a25,"blue")



Karen wrote:

Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 136
Default COUNTIF

Hi Karen

In the cell where you want result to be type...

If you want the individual total..

=COUNTIF(A1:A25,"Red")

In next another totla cell =COUNTIF(A1:A25,"Blue")

Or together

=COUNTIF(A1:A25,"Red")+COUNTIF(A1:A25,"Blue")

Hope this helps,

Gav.

"Karen" wrote:

Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default COUNTIF

=COUNTIF(A1:A25,"Red")
=COUNTIF(A1:A25,"Blue")

--
Gary''s Student - gsnu200752
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default COUNTIF

On Oct 31, 8:44 am, Karen wrote:
Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen


Try...

=COUNTIF(A1:A25,"Red")+COUNTIF(A1:A25,"Blue")

or

=SUM(COUNTIF(A1:A25,{"Red","Blue"}))

Hope this helps!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default COUNTIF

=SUMPRODUCT(N(A1:A25={"Blue","Red"}))

"Karen" wrote:

Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 447
Default COUNTIF

Thank you for your help
Karen

"Dave Peterson" wrote:

And these are the words Red and Blue--not the actual colors, right?

=sum(countif(a1:a25,{"Red","Blue"}))

or you could each separately:

=countif(a1:a25,"Red") + countif(a1:a25,"blue")



Karen wrote:

Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 447
Default COUNTIF

Thank you for your help
Karen


"Gav123" wrote:

Hi Karen

In the cell where you want result to be type...

If you want the individual total..

=COUNTIF(A1:A25,"Red")

In next another totla cell =COUNTIF(A1:A25,"Blue")

Or together

=COUNTIF(A1:A25,"Red")+COUNTIF(A1:A25,"Blue")

Hope this helps,

Gav.

"Karen" wrote:

Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 447
Default COUNTIF

Thank you for your help
Karen


" wrote:

On Oct 31, 8:44 am, Karen wrote:
Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen


Try...

=COUNTIF(A1:A25,"Red")+COUNTIF(A1:A25,"Blue")

or

=SUM(COUNTIF(A1:A25,{"Red","Blue"}))

Hope this helps!


  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 447
Default COUNTIF

Thank you for your help
Karen


"Teethless mama" wrote:

=SUMPRODUCT(N(A1:A25={"Blue","Red"}))

"Karen" wrote:

Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 447
Default COUNTIF

Thank you for your help
Karen


"Gary''s Student" wrote:

=COUNTIF(A1:A25,"Red")
=COUNTIF(A1:A25,"Blue")

--
Gary''s Student - gsnu200752

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 447
Default COUNTIF

Yes, these are the words
Thanks

"Dave Peterson" wrote:

And these are the words Red and Blue--not the actual colors, right?

=sum(countif(a1:a25,{"Red","Blue"}))

or you could each separately:

=countif(a1:a25,"Red") + countif(a1:a25,"blue")



Karen wrote:

Let's say I have a range of data from A1:A25 and I want to use the COUNTIF
function to count how many times 2 different conditions fall within this
range. The conditions are "Red" and "Blue" - What would the formula be? I'm
assuming I use the COUNTIF function.

ANY help would be greatly appreciated, Karen


--

Dave Peterson

  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default COUNTIF

That didn't work for me.

I bet you meant:
=SUM(COUNTIF(A1:A25,{"Red","Blue"}))
(not an array formula)

Alan Beban wrote:

Gary''s Student wrote:
=COUNTIF(A1:A25,"Red")
=COUNTIF(A1:A25,"Blue")

Or simply =COUNTIF(A1:A25,{"Red","Blue"}) array entered into a
two-column row.

Alan Beban


--

Dave Peterson
  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 783
Default COUNTIF

Gary''s Student wrote:
=COUNTIF(A1:A25,"Red")
=COUNTIF(A1:A25,"Blue")

Or simply =COUNTIF(A1:A25,{"Red","Blue"}) array entered into a
two-column row.

Alan Beban
  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 783
Default COUNTIF

No; I meant =COUNTIF(A1:A25,{"Red","Blue"}) array entered. :-)

Excel 2002. What version are you using?

Note that I was responding to Gary's Student (who was proposing one
result for each color), not proposing a formula to return the sum.

Regards,
Alan

Dave Peterson wrote:
That didn't work for me.

I bet you meant:
=SUM(COUNTIF(A1:A25,{"Red","Blue"}))
(not an array formula)

Alan Beban wrote:

Gary''s Student wrote:

=COUNTIF(A1:A25,"Red")
=COUNTIF(A1:A25,"Blue")


Or simply =COUNTIF(A1:A25,{"Red","Blue"}) array entered into a
two-column row.

Alan Beban





  #16   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default COUNTIF

xl2003.

If I select the cell and highlight the formula in the formulabar, then hit F9, I
see:
={2,1}

with two Red's and one Blue in A1:A25

If there are no Red's in the range, I see 0 in the cell.

If I do the same thing (evaluate the formula), I see:
={0,1}

Alan Beban wrote:

No; I meant =COUNTIF(A1:A25,{"Red","Blue"}) array entered. :-)

Excel 2002. What version are you using?

Note that I was responding to Gary's Student (who was proposing one
result for each color), not proposing a formula to return the sum.

Regards,
Alan

Dave Peterson wrote:
That didn't work for me.

I bet you meant:
=SUM(COUNTIF(A1:A25,{"Red","Blue"}))
(not an array formula)

Alan Beban wrote:

Gary''s Student wrote:

=COUNTIF(A1:A25,"Red")
=COUNTIF(A1:A25,"Blue")


Or simply =COUNTIF(A1:A25,{"Red","Blue"}) array entered into a
two-column row.

Alan Beban




--

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
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
countif maryj Excel Worksheet Functions 1 April 15th 05 05:49 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


All times are GMT +1. The time now is 02:14 PM.

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"