LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default function malfunctioning using countif and a variable

Hi,

I have the following function

Function cohort(stap As Double) As Double
cohort = Application.CountIf(Worksheets("deelnemers").Range ("D3:D992"),
"<stap+5") - Application.CountIf(Worksheets("deelnemers").Range ("D3:D992"),
"<stap")
End Function

The problem is that the function does not recognise "stap" in the function.
If i replace stap with a number then the function works. but i need the
number to be a variable..

some additional info
on sheet "deelnemers" there is a list of people with ages in column D
stap is the age of the people. So for example i want to know the number of
people between 30(stap + 5) and 25(stap)

I've been puzzling for ours but no result other then i know wher the function
goes wrong.
any adeas ?


--
Message posted via http://www.officekb.com
 
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
Excel lock / Notify feature malfunctioning andrei999 Excel Worksheet Functions 0 June 24th 09 03:28 PM
Automatic value is malfunctioning annie Excel Worksheet Functions 1 July 6th 07 02:10 PM
How to use VBA variable in COUNTIF function? terry Excel Worksheet Functions 10 November 19th 06 05:05 PM
Sorting malfunctioning aposatsk New Users to Excel 10 July 25th 06 09:58 PM
Fitter malfunctioning? itgoeson Charts and Charting in Excel 2 August 3rd 05 10:13 PM


All times are GMT +1. The time now is 07:17 PM.

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"