Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 187
Default count even-numbered values in a range

I have a range of randomly generated, positive whole numbers and need
to count the even values.

I assumed something like =SUM(--(ISEVEN(A1:A100))) entered as an array
formula would work, similar to entering =SUM(--(ISBLANK(A1:A100))) as
an array formula counts the blank cells within the referenced range.

But using ISEVEN in this manner returns #VALUE!

Is there another way to do this?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 187
Default count even-numbered values in a range

I seem to have answered this: =SUM(--MOD(A1:A100,2)) entered as an
array gives the correct answer.

Dave

On Aug 1, 10:45 am, Dave F wrote:
I have a range of randomly generated, positive whole numbers and need
to count the even values.

I assumed something like =SUM(--(ISEVEN(A1:A100))) entered as an array
formula would work, similar to entering =SUM(--(ISBLANK(A1:A100))) as
an array formula counts the blank cells within the referenced range.

But using ISEVEN in this manner returns #VALUE!

Is there another way to do this?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default count even-numbered values in a range

=SUMPRODUCT(--(MOD(A1:A100,2)=0)) will work
or
=SUM(--(MOD(A1:A100,2)=0)) as an array formula

Are you sure that =SUM(--(ISBLANK(A1:A100))) works?
--
David Biddulph

"Dave F" wrote in message
ups.com...
I have a range of randomly generated, positive whole numbers and need
to count the even values.

I assumed something like =SUM(--(ISEVEN(A1:A100))) entered as an array
formula would work, similar to entering =SUM(--(ISBLANK(A1:A100))) as
an array formula counts the blank cells within the referenced range.

But using ISEVEN in this manner returns #VALUE!

Is there another way to do this?

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default count even-numbered values in a range

Try this array* formula:

=SUM(IF(MOD(A1:A100,2)=0,A1:A100))

* Commit with CTRL-SHIFT-ENTER

Hope this helps.

Pete

On Aug 1, 3:45 pm, Dave F wrote:
I have a range of randomly generated, positive whole numbers and need
to count the even values.

I assumed something like =SUM(--(ISEVEN(A1:A100))) entered as an array
formula would work, similar to entering =SUM(--(ISBLANK(A1:A100))) as
an array formula counts the blank cells within the referenced range.

But using ISEVEN in this manner returns #VALUE!

Is there another way to do this?

Thanks.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 187
Default count even-numbered values in a range

Every time I've used =SUM(--(ISBLANK(A1:A100))) it has worked.

I solved this particular problem with: =100-(SUM(--MOD(M2:M101,2)))
entered as an array formula.

On Aug 1, 11:06 am, "David Biddulph" <groups [at] biddulph.org.uk
wrote:
=SUMPRODUCT(--(MOD(A1:A100,2)=0)) will work
or
=SUM(--(MOD(A1:A100,2)=0)) as an array formula

Are you sure that =SUM(--(ISBLANK(A1:A100))) works?
--
David Biddulph

"Dave F" wrote in message

ups.com...



I have a range of randomly generated, positive whole numbers and need
to count the even values.


I assumed something like =SUM(--(ISEVEN(A1:A100))) entered as an array
formula would work, similar to entering =SUM(--(ISBLANK(A1:A100))) as
an array formula counts the blank cells within the referenced range.


But using ISEVEN in this manner returns #VALUE!


Is there another way to do this?


Thanks.- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 772
Default count even-numbered values in a range

Hard to tell without seeing your data, but =MOD(A1,2) tells whether a number
is evenly divisible. If it returns a 0 it is even.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Dave F" wrote:

I have a range of randomly generated, positive whole numbers and need
to count the even values.

I assumed something like =SUM(--(ISEVEN(A1:A100))) entered as an array
formula would work, similar to entering =SUM(--(ISBLANK(A1:A100))) as
an array formula counts the blank cells within the referenced range.

But using ISEVEN in this manner returns #VALUE!

Is there another way to do this?

Thanks.


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 Numbered Items JB Excel Discussion (Misc queries) 3 January 13th 07 02:39 PM
how do i count cells with values in a certain range ? Capt. Trevor Bailey Excel Discussion (Misc queries) 3 October 11th 06 03:48 PM
Count text values in a date range Janet BN Excel Discussion (Misc queries) 2 June 19th 06 04:26 AM
Count the how many different values in a range beechum1 Excel Worksheet Functions 3 February 12th 06 06:45 AM
How to count a range of values in a single cell? nyc_doc Excel Worksheet Functions 3 August 3rd 05 12:30 AM


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