Thread: Syntax errot
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 46
Default Syntax errot

Paul's suggestions
When I insert the worksheet formula I get "#value", although there
appears that I'm working only with numbers.

When I try to run the VBA all on one line I get the Compile error -
"sub or function not defined".

---------------------------------------------------------------------

Rick's suggestions

When I try to run his suggestion I get the message:
Unable to get the minimum property of the worksheet function class.
class


-----------------------------------------------------------------------------

On Tue, 31 Mar 2009 07:39:25 -0700 (PDT),
wrote:

Hi
As a worksheet formula in cell a13
=if (and(min("a5:a9")< average("a5:a9")*0.95 , max("a5:a9") average
("a5:a9")*1.05) , "fail" , "pass")

As VBA
if min(Range("a5:a9"))< worksheetfunctions.average(Range("a5:a9"))
*0.95 and max(Range("a5:a9")) worksheetfunctions.average(Range
("a5:a9"))* 1.05
then Range("a13").value = "fail" else Range("a13").value = "pass"

the VBA should all be on one line


regards
Paul



On Mar 31, 3:08*pm, Ed wrote:
Please advise how to correct syntax error in the following:

if min(a5:a9)< avg(a5:a9)*0.95 and if max(a5:a9) avg(a5:a9)* 1.05
then a13 = *"fail" else a13 = "pass"

Thank you