A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Using countif on non-consecutive cells



 
 
Thread Tools Display Modes
  #1  
Old March 2nd 10, 02:39 AM posted to microsoft.public.excel.worksheet.functions
Marty
external usenet poster
 
Posts: 116
Default Using countif on non-consecutive cells

How do I use the countif on non-concecutive cells, i.e. I want to know the
number of certain cells in worksheet that contain a specific value. For
instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
--
Marty
Ads
  #2  
Old March 2nd 10, 03:27 AM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,718
Default Using countif on non-consecutive cells

=SUM(COUNTIF(INDIRECT({"A1:A5","A7","A15:A18"}),1) )


"Marty" wrote:

> How do I use the countif on non-concecutive cells, i.e. I want to know the
> number of certain cells in worksheet that contain a specific value. For
> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
> --
> Marty

  #3  
Old March 2nd 10, 03:32 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,768
Default Using countif on non-consecutive cells

If you only have a "few" cells to check:

=(A1=1)+(A5=1)+(A7=1)+(A15=1)+(A18=1)

If you have "many" cells to check it depends on the range of numbers that
the cells can contain but you use something like this if the lowest possible
number is the number 1:

=INDEX(FREQUENCY((A1,A5,A7,A15,A18),1),1)

--
Biff
Microsoft Excel MVP


"Marty" > wrote in message
...
> How do I use the countif on non-concecutive cells, i.e. I want to know the
> number of certain cells in worksheet that contain a specific value. For
> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
> --
> Marty



  #4  
Old March 2nd 10, 03:35 AM posted to microsoft.public.excel.worksheet.functions
Teethless mama
external usenet poster
 
Posts: 3,718
Default Using countif on non-consecutive cells

Non Volatile formula

=COUNTIF(A1:A5,1)+(A7=1)+COUNTIF(A15:A18,1)


"Marty" wrote:

> How do I use the countif on non-concecutive cells, i.e. I want to know the
> number of certain cells in worksheet that contain a specific value. For
> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
> --
> Marty

  #5  
Old March 2nd 10, 06:28 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,768
Default Using countif on non-consecutive cells

>if the lowest possible number is the number 1:
>=INDEX(FREQUENCY((A1,A5,A7,A15,A18),1),1)


If the lowest possible number is the number 1 that can be reduced to:

=FREQUENCY((A1,A5,A7,A15,A18),1)

>how many cells in a1:a5, a7, a15:a18 contain the value of 1.


Also, due to my poor eyesight I didn't notice that A1:A5 and A15:A18 were
ranges but that doesn't make any difference:

=FREQUENCY((A1:A5,A7,A15:A18),1)

--
Biff
Microsoft Excel MVP


"T. Valko" > wrote in message
...
> If you only have a "few" cells to check:
>
> =(A1=1)+(A5=1)+(A7=1)+(A15=1)+(A18=1)
>
> If you have "many" cells to check it depends on the range of numbers that
> the cells can contain but you use something like this if the lowest
> possible number is the number 1:
>
> =INDEX(FREQUENCY((A1,A5,A7,A15,A18),1),1)
>
> --
> Biff
> Microsoft Excel MVP
>
>
> "Marty" > wrote in message
> ...
>> How do I use the countif on non-concecutive cells, i.e. I want to know
>> the
>> number of certain cells in worksheet that contain a specific value. For
>> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
>> --
>> Marty

>
>



  #6  
Old March 2nd 10, 09:52 AM posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_]
external usenet poster
 
Posts: 8,651
Default Using countif on non-consecutive cells

I think you mistook some of the OP's colons for commas, Biff.
--
David Biddulph


"T. Valko" > wrote in message
...
> If you only have a "few" cells to check:
>
> =(A1=1)+(A5=1)+(A7=1)+(A15=1)+(A18=1)
>
> If you have "many" cells to check it depends on the range of numbers that
> the cells can contain but you use something like this if the lowest
> possible number is the number 1:
>
> =INDEX(FREQUENCY((A1,A5,A7,A15,A18),1),1)
>
> --
> Biff
> Microsoft Excel MVP
>
>
> "Marty" > wrote in message
> ...
>> How do I use the countif on non-concecutive cells, i.e. I want to know
>> the
>> number of certain cells in worksheet that contain a specific value. For
>> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
>> --
>> Marty

>
>


  #7  
Old March 2nd 10, 06:03 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,768
Default Using countif on non-consecutive cells

Yes, I can barely see to read anymore late at night!

Sitting in front of a computer monitor all day long is not good for your
eyesight!

--
Biff
Microsoft Excel MVP


"David Biddulph" <groups [at] biddulph.org.uk> wrote in message
...
>I think you mistook some of the OP's colons for commas, Biff.
> --
> David Biddulph
>
>
> "T. Valko" > wrote in message
> ...
>> If you only have a "few" cells to check:
>>
>> =(A1=1)+(A5=1)+(A7=1)+(A15=1)+(A18=1)
>>
>> If you have "many" cells to check it depends on the range of numbers that
>> the cells can contain but you use something like this if the lowest
>> possible number is the number 1:
>>
>> =INDEX(FREQUENCY((A1,A5,A7,A15,A18),1),1)
>>
>> --
>> Biff
>> Microsoft Excel MVP
>>
>>
>> "Marty" > wrote in message
>> ...
>>> How do I use the countif on non-concecutive cells, i.e. I want to know
>>> the
>>> number of certain cells in worksheet that contain a specific value. For
>>> instance, how many cells in a1:a5, a7, a15:a18 contain the value of 1.
>>> --
>>> Marty

>>
>>

>



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
=COUNTIF & how to make it apply to consecutive cells gretchen Excel Worksheet Functions 2 July 24th 08 06:15 PM
Countif non consecutive columns shamor New Users to Excel 8 May 31st 08 09:14 PM
Using Countif to Count Consecutive Relative Increases in Numbers SteveC Excel Discussion (Misc queries) 16 September 27th 06 04:55 PM
Countif in non-consecutive cells michaelberrier Excel Discussion (Misc queries) 4 June 24th 06 10:43 PM
sumif/countif on non-consecutive colums - array? Gerald Koch Excel Worksheet Functions 2 November 29th 04 06:21 PM


All times are GMT +1. The time now is 06:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.