#1   Report Post  
John
 
Posts: n/a
Default COUNTIF Q

I am trying to get the syntax of a COUNTIF function correct and am having a
little problem. I am trying to COUNTIF a number of separate cells within the
formula as opposed to a range. For example

COUNTIF(A1,C1,E1"1") - this produces an error within the formula

Not sure if you can only do a continuous range i.e. COUNTIF(A1:E1,"1"), my
problem is I don't want to count B or D


Thanks


  #2   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

John wrote:
I am trying to get the syntax of a COUNTIF function correct and am having a
little problem. I am trying to COUNTIF a number of separate cells within the
formula as opposed to a range. For example

COUNTIF(A1,C1,E1"1") - this produces an error within the formula

Not sure if you can only do a continuous range i.e. COUNTIF(A1:E1,"1"), my
problem is I don't want to count B or D


Thanks



If the counting is restricted to just 3 cells...

=(A11)+(C11)+(E10)
  #3   Report Post  
Leo Heuser
 
Posts: n/a
Default

John

Yes, COUNTIF only takes a contiguous range as argument.

Instead try this formula:

=INDEX(FREQUENCY((A1,C5,C8,A9:A10),1),2)

or, if you name the non-contiguous range e.g. "Rng"

For values 1

=INDEX(FREQUENCY(Rng,1),2)

for values = 1

=INDEX(FREQUENCY(Rng,{0.999999999999999,1}),2)

and for values <=1

=FREQUENCY(Rng,1)


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"John" skrev i en meddelelse
...
I am trying to get the syntax of a COUNTIF function correct and am having a
little problem. I am trying to COUNTIF a number of separate cells within
the formula as opposed to a range. For example

COUNTIF(A1,C1,E1"1") - this produces an error within the formula

Not sure if you can only do a continuous range i.e. COUNTIF(A1:E1,"1"),
my problem is I don't want to count B or D


Thanks







  #4   Report Post  
John
 
Posts: n/a
Default

Thanks guys

Leo your suggestion fits nicely

"Leo Heuser" wrote in message
...
John

Yes, COUNTIF only takes a contiguous range as argument.

Instead try this formula:

=INDEX(FREQUENCY((A1,C5,C8,A9:A10),1),2)

or, if you name the non-contiguous range e.g. "Rng"

For values 1

=INDEX(FREQUENCY(Rng,1),2)

for values = 1

=INDEX(FREQUENCY(Rng,{0.999999999999999,1}),2)

and for values <=1

=FREQUENCY(Rng,1)


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"John" skrev i en meddelelse
...
I am trying to get the syntax of a COUNTIF function correct and am having
a
little problem. I am trying to COUNTIF a number of separate cells within
the formula as opposed to a range. For example

COUNTIF(A1,C1,E1"1") - this produces an error within the formula

Not sure if you can only do a continuous range i.e. COUNTIF(A1:E1,"1"),
my problem is I don't want to count B or D


Thanks









  #5   Report Post  
Leo Heuser
 
Posts: n/a
Default

You're welcome, John. Thanks for the feedback :-)

LeoH


"John" skrev i en meddelelse
...
Thanks guys

Leo your suggestion fits nicely



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 COMBINATION?? Heather Excel Worksheet Functions 1 April 26th 05 02:44 AM
Combining IF and COUNTIF based on two columns maxtrixx Excel Discussion (Misc queries) 5 March 31st 05 06:21 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 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 06:13 AM.

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"