Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 98
Default Excel - count if a number falls within an array in a column & add

Trying to write a formula that creates a count if a number in a cell in an
array (a column) falls within a certain range, and then adds them up: e.g.
1.9
1
3.2
0.5

I want to count if a number is greater (or equal) to 0.5 but less than 2,
and then add them up to return a value (3). I've tried IF, COUNTIF, AND, OR
but can't get it to work - Any ideas? Nigel.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Excel - count if a number falls within an array in a column & add

Sumproduct should prove useful here ...
.. count if a number is greater (or equal) to 0.5 but less than 2

=sumproduct((a2:a10=0.5)*(a2:a10<2))

.. then add them up to return a value

=sumproduct((a2:a10=0.5)*(a2:a10<2),a2:a10)
Success? wave it here, hit the YES below
--
Max
Singapore
---
"Nigel" wrote:
Trying to write a formula that creates a count if a number in a cell in an
array (a column) falls within a certain range, and then adds them up: e.g.
1.9
1
3.2
0.5

I want to count if a number is greater (or equal) to 0.5 but less than 2,
and then add them up to return a value (3). I've tried IF, COUNTIF, AND, OR
but can't get it to work - Any ideas? Nigel.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Excel - count if a number falls within an array in a column &

Here's another way of doing it:
=SUMPRODUCT(--(A1:A13=0.5),--(A1:A13<2))


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Max" wrote:

Sumproduct should prove useful here ...
.. count if a number is greater (or equal) to 0.5 but less than 2

=sumproduct((a2:a10=0.5)*(a2:a10<2))

.. then add them up to return a value

=sumproduct((a2:a10=0.5)*(a2:a10<2),a2:a10)
Success? wave it here, hit the YES below
--
Max
Singapore
---
"Nigel" wrote:
Trying to write a formula that creates a count if a number in a cell in an
array (a column) falls within a certain range, and then adds them up: e.g.
1.9
1
3.2
0.5

I want to count if a number is greater (or equal) to 0.5 but less than 2,
and then add them up to return a value (3). I've tried IF, COUNTIF, AND, OR
but can't get it to work - Any ideas? Nigel.

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
count array for top three entries and return their number Rich DeVito Excel Discussion (Misc queries) 4 September 21st 09 02:29 AM
Excel - find where a number falls in a start and end range Mkuria New Users to Excel 3 October 21st 08 08:05 PM
count no. of dates in a column that falls on certain month & year RawSugar Excel Worksheet Functions 2 October 20th 05 10:50 PM
how to count if the value falls between a date range joe Excel Discussion (Misc queries) 3 September 28th 05 04:37 AM
Formula to count number of dates in an array Lilasviolet Excel Worksheet Functions 2 April 7th 05 07:44 PM


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