Results 1 to 7 of 7

Setting ranges for comparison operators

Threaded View

  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    O.o
    MS-Off Ver
    Excel 2003
    Posts
    64

    Setting ranges for comparison operators

    Hi everyone,

    Is it possible to set a range using comparison operators? ie. if a number lies within x and y then such and such happens.

    To be more precise:

    Function grade(maths As Double, english As Double, science As Double) As String
    
    If maths >= 70 And english >= 70 And science >= 70 Then
        grade = "Distinction"
    
    ElseIf maths >= 70 And english >= 50 And science >= 50 Then
        grade = "Merit"
    
    ElseIf maths < 50 Or english < 50 Or science < 50 Then
        grade = "Fail"
        
    End If
    End Function
    Focusing on the red text, I was hoping to set english and science so that they are also < 70 (lie between 50 - 69).

    Thanks for your time!
    Last edited by dems; 07-22-2009 at 10:14 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1