Countnumberofdays while function = TRUE
How do I enter this in Excel? Is it possible to write a function with it?
Something like (I don't know how I have to write a correct function):
Function GrowDay(Wstart, Wstop)
x = 1
x = 0
W = Wstart
Do
x = x + 1
res = W(x - 1) + _
(0.1 * W(x - 1) ^ (2 / 3) - 0.05 * W(x - 1)) * f(Temp)
Loop While res <= Wstop
End Function
Maarten
"Tom Ogilvy" wrote:
x = 1
x = 0
do
x = x + 1
res = W(x-1) + _
(0.1*W(x-1)^(2/3)-0.05*W(x-1))*f(Temp)
Loop while res <= 10
--
Regards,
Tom Ogilvy
"Maarten" wrote in message
...
But B doesn't contain the weights of the animals. The weights should be
calculated invisible, behind each cell in B.
B1 may only contain the number of days the animal needs to reach a weight
of
10 grams, assuming that it enters the simulation on the day that
corresponds
to cell B1
B2 may only contain the number of days the animal needs to reach a weight
of
10 grams, assuming that it enters the simulation on the day that
corresponds
to cell B2
B3 may only contain the number of days the animal needs to reach a weight
of
10 grams, assuming that it enters the simulation on the day that
corresponds
to cell B3
etc...
"Tom Ogilvy" wrote:
If each row is a day, then it should be as simple as:
=countif(B:B,"<=10")
No macro required.
As a further example, If you want to count 10 and <=20
=Countif(B:B,"10")-Countif(B:B,"20")
--
Regards,
Tom Ogilvy
|