Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Error using WorksheetFunction.Countif

You could dump the array to a worksheet range and then use that, but in
reality you just need to use the functions as designed. Just as you can't
pass a string to a function expecting a number and expect to get a
reasonable result, the same is true here.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Kris_Wright_77" wrote in message
...
Thanks for the explanation, Bob.

Is there a way around the problem without resorting to a "loop" or

multiple
lines of similar code to see which numbers reoccur within the array?

Thanks for any more help that anyone can give.

Kris

"Bob Phillips" wrote:

That is because those 3 functions can work on an array of numbers,

COUNTIF
cannot, it needs a range as the first argument. To demonstrate this, try
this in Excel

=AVERAGE({1,2,3,4,5})

Then try

=COUNTIF({1,2,3,4,5},3)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)



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
worksheetfunction.sum error Monique Excel Programming 4 July 17th 05 04:43 PM
Error '1004' in WorksheetFunction oakman[_16_] Excel Programming 0 November 18th 04 01:48 PM
Error '1004' in WorksheetFunction oakman[_15_] Excel Programming 1 November 17th 04 08:16 PM
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? Etien[_2_] Excel Programming 3 January 13th 04 04:07 PM
WorksheetFunction.CountIf & Worksheet.SumIf with 2 conditions? Etien Excel Programming 0 January 12th 04 06:11 PM


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