#1   Report Post  
David Harrison
 
Posts: n/a
Default CountIf Function

HI there

I have a current count IF function that works well. until now.

The range is D4:D9,

Usually it only searches numbers but now i need it to search 8a and 8b as
values. Not the cells.

What is the way around this.

It would be more preferable to seach and add up 8a and 8a as values. (not
the cells 8a and 8b)

Thanks

David
  #2   Report Post  
Leo Heuser
 
Posts: n/a
Default

Hi David

One way:

=COUNTIF(D4:D9,"8a")

and for counting the numbers of 8a AND 8b

=SUMPRODUCT(COUNTIF(D4:D9,{"8a,"8b"}"))


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"David Harrison" skrev i en
meddelelse ...
HI there

I have a current count IF function that works well. until now.

The range is D4:D9,

Usually it only searches numbers but now i need it to search 8a and 8b as
values. Not the cells.

What is the way around this.

It would be more preferable to seach and add up 8a and 8a as values. (not
the cells 8a and 8b)

Thanks

David



  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default


"Leo Heuser" wrote in message
...


and for counting the numbers of 8a AND 8b

=SUMPRODUCT(COUNTIF(D4:D9,{"8a,"8b"}"))


Typos apart, why introduce a nested function call?

=SUMPRODUCT(--(D4:D9={"8a","8b"}))


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

"Bob Phillips" skrev i en meddelelse
...

"Leo Heuser" wrote in message
...


and for counting the numbers of 8a AND 8b

=SUMPRODUCT(COUNTIF(D4:D9,{"8a,"8b"}"))


Typos apart, why introduce a nested function call?


Good question! I guess, I was caught by the subject line.

How on earth did that quotation mark land after "}" instead of after "a" :-)



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

Hi Bob

The expression

--(D4:D9={"8a","8b"})

returns a 2-dimensional (6 x 2) array

where

COUNTIF(D4:D9,{"8a,"8b"}")

returns a 1-dimensional (1 x 2) array

Either one might be useful depending on, which
functions are to be used on them.

To get the sum, either one may be used, and my
solution may be less memory hungry than yours,
depending on how Excel treats the functions internally.
OTOH it uses one more function call.


LeoH


"Bob Phillips" skrev i en meddelelse
...

"Leo Heuser" wrote in message
...


and for counting the numbers of 8a AND 8b

=SUMPRODUCT(COUNTIF(D4:D9,{"8a,"8b"}"))


Typos apart, why introduce a nested function call?

=SUMPRODUCT(--(D4:D9={"8a","8b"}))




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
using countif function to add only a half of a number ryanjh79 Excel Discussion (Misc queries) 9 April 26th 23 03:42 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
How do I use COUNTIF in a SUBTOTAL function to differentiate the . Lettie Excel Worksheet Functions 6 March 22nd 05 08:47 AM
Advanced COUNTIF Function License Boy Excel Worksheet Functions 3 December 8th 04 02:23 PM
The countif function in Excel 2002. Lounsbud Excel Worksheet Functions 1 November 22nd 04 03:19 PM


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