+ Reply to Thread
Results 1 to 1 of 1

VBA Function Statement

Hybrid View

  1. #1
    Registered User
    Join Date
    07-31-2013
    Location
    AbuDhabi, UAE
    MS-Off Ver
    Excel 2007
    Posts
    21

    VBA Conditional IF Function not working

    Dear all,

    i have this code below and its not working:

    Public Function BonusCalculation_1(Branch As String, Tier As String, Rating As Double)
    
    If Branch = "LA2" Then
       If Tier = "3R" Then
                    If Rating = 5 Then
                        BonusCalculation_1 = 3000
                    ElseIf Rating = 4 And Rating =3 Then
                        BonusCalculation_1 = 2000
                    Else
                        BonusCalculation_1 = 0
                    End If
    
       Else
       
       If Tier = "2R" Then
             
                    If Rating = 5 Then
                        BonusCalculation_1 = 2500
                    ElseIf Rating = 4 And Rating = 3 Then
                        BonusCalculation_1 = 1500
                    Else
                        BonusCalculation_1 = 0
                    End If
    
        Else
        
        End If
    
    End If
        
    End Function
    Last edited by ssq; 10-22-2013 at 06:47 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using the 'NOW' function within an 'IF' statement
    By rminns in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-12-2011, 04:01 PM
  2. If Statement Function
    By FenrisRising in forum Excel General
    Replies: 1
    Last Post: 07-27-2007, 06:26 PM
  3. MAX function with IF Statement
    By dbuc283 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2006, 11:40 AM
  4. MAX function with IF Statement
    By dbuc283 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-02-2006, 11:15 AM
  5. MID STATEMENT vs MID FUNCTION
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-28-2005, 01:05 PM

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