Probably a stupid question..but Im just starting out

  • Thread starter Thread starter AlphaElyssia
  • Start date Start date
A

AlphaElyssia

How would I write a function to tell me whether a number was 'high' ,
'medium' or 'low' according to my specifications of what a high, medium
or low figure was ( for example, exam marks where a low is below 40,
medium between 41 and 70 and high above 70)
 
danke schon- but could i do it as a program not an if statement? Even i
its a long way to do it, I wanna impress said examiner ;)

Thanks loads though *:D
 
Alpha, here is one way =IF(A1>70,"High",IF(A1>40,"Medium","Low"))

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 
Try this:

Function HighLow(ByRef InputCell As Range)
If Not WorksheetFunction.IsNumber(InputCell.Value) Then
HighLow = "Not Numeric"
Exit Function
End If
Select Case InputCell.Value
Case Is < 41: HighLow = "Low"
Case 41 To 70: HighLow = "Medium"
Case Is > 70: HighLow = "High"
Case Else
End Select
End Function

Regards

Trevor
 
Back
Top