Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default syntax for countif when cells fall within a numerical range

I have a column of numerical data, for which I need frequency counts within
certain ranges. E.G. If a cell value is = 41 AND <= 50, I want to count
that cell as one. I can't figure out the syntax.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 100
Default syntax for countif when cells fall within a numerical range

Countif can only be used with one criteria.

Use Sumproduct instead. For example, if your list is in A1:A100, you could
use =SUMPRODUCT(--(A1:A100=41),--(A1:A100<=50))

"Tom L" wrote:

I have a column of numerical data, for which I need frequency counts within
certain ranges. E.G. If a cell value is = 41 AND <= 50, I want to count
that cell as one. I can't figure out the syntax.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default syntax for countif when cells fall within a numerical range

Countif can only be used with one criteria.

Think we could use 2 countifs as another option:
=COUNTIF(A:A,"=41")-COUNTIF(A:A,"50")
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 100
Default syntax for countif when cells fall within a numerical range

Ha, very cute. It's not really 'one' countif, but I like it anyways.

"Max" wrote:

Countif can only be used with one criteria.


Think we could use 2 countifs as another option:
=COUNTIF(A:A,"=41")-COUNTIF(A:A,"50")
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default syntax for countif when cells fall within a numerical range

Countif can only be used with one criteria.

But you can use more criteria when nested inside another function like this:

=SUM(COUNTIF(A1:A20,{"=41","50"})*{1,-1})

=SUM(COUNTIF(A1:A20,{"X","Y","Z"}))

G1:G3 = X, Y, Z

=SUMPRODUCT(COUNTIF(A1:A20,G1:G3))


--
Biff
Microsoft Excel MVP


"sb1920alk" wrote in message
...
Countif can only be used with one criteria.

Use Sumproduct instead. For example, if your list is in A1:A100, you could
use =SUMPRODUCT(--(A1:A100=41),--(A1:A100<=50))

"Tom L" wrote:

I have a column of numerical data, for which I need frequency counts
within
certain ranges. E.G. If a cell value is = 41 AND <= 50, I want to count
that cell as one. I can't figure out the syntax.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default syntax for countif when cells fall within a numerical range

"Tom L" wrote:
I have a column of numerical data, for which I need frequency counts within
certain ranges. E.G. If a cell value is = 41 AND <= 50, I want to count
that cell as one. I can't figure out the syntax.


One way, via sumproduct, eg:
=SUMPRODUCT((A2:A10=41)*(A2:A10<=50))
Adapt the range to suit.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
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
Highlight data that doesn't fall within certaint range Rob Allmighty Excel Worksheet Functions 2 September 20th 07 02:03 AM
Adding amounts that fall within a range pdgaustintexas Excel Worksheet Functions 6 January 21st 06 01:55 PM
Counting if numbers fall within a specified range KG Excel Discussion (Misc queries) 4 September 10th 05 02:30 PM
How to total itmes if they fall between a date range cel Excel Worksheet Functions 1 May 17th 05 07:39 PM
range and cells syntax mango Excel Worksheet Functions 0 February 22nd 05 12:03 AM


All times are GMT +1. The time now is 01:37 AM.

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"