PDA

View Full Version : Solved: Response Time Formula



rajkumar
12-29-2010, 05:29 PM
Hi,

I have a function that calculates response time for service calls.



Function RTNOTMET(Group As Range, RT As Range) As String
If IsEmpty(RT) Then RTNOTMET = "BLANK DATA": Exit Function
Select Case Group.Value
Case "SFIDA", "MALTA", "DP180F", "IGEN": LIMIT = 2
Case "DC12", "OLYMPIA", "FUJHIN", "XES PSG": LIMIT = 4
Case Else: RTNOTMET = Empty: Exit Function
End Select
If RT.Value > LIMIT Then RTNOTMET = "RT NOT MET" Else: RTNOTMET = "RT MET"
End Function


In this function the select case method is used to arrive RT NOT MET AND RT MET OR BLANK DATA.

I need help in including one more condition in this.

If Case "SFIDA", "MALTA", "DP180F", "IGEN": LIMIT < 3 but > 2 then RT NOT MET

If Case "DC12", "OLYMPIA", "FUJHIN", "XES PSG": LIMIT < 6 but > 4 then RT NOT MET

If Case "SFIDA", "MALTA", "DP180F", "IGEN": LIMIT < 2 then RT MET

If Case "DC12", "OLYMPIA", "FUJHIN", "XES PSG": LIMIT < 4 then RT MET

Else RT TAIL

Please help to alter the function to suite my requirement
Raj :help

Bob Phillips
12-30-2010, 04:02 AM
Function RTNOTMET(Group As Range, RT As Range) As String
If IsEmpty(RT) Then RTNOTMET = "BLANK DATA": Exit Function
Select Case Group.Value
Case "SFIDA", "MALTA", "DP180F", "IGEN":
If RT.Value > 2 And RT.Value < 3 Then
RTNOTMET = "RT NOT MET"
ElseIf RT.Value < 2 Then
RTNOTMET = "RT MET"
Else
RTNOTMET = "RT TAIL"
End If
Case "DC12", "OLYMPIA", "FUJHIN", "XES PSG"
If RT.Value > 4 And RT.Value < 6 Then
RTNOTMET = "RT NOT MET"
ElseIf RT.Value < 4 Then
RTNOTMET = "RT MET"
Else
RTNOTMET = "RT TAIL"
End If
Case Else: RTNOTMET = Empty
End Select
End Function

rajkumar
12-30-2010, 07:53 AM
Xld,

You are a genius.

Works great !! thanks!.
Raj :thumb