-
Custom Function to Calculate Response Time
Dear p45cal,
sorry for not briefing clearly.
For GroupA there are three products SFIDA,MALTA,DP180F and these carry 2 hrs response time ie. the call need to be attended within 2hrs.
If the call is attended after 2hrs from the logged time then it becomes response time tail (RTTAIL).
And similarly for GroupB there are four products DC12,Olympia,Fujhin,XES PSG and these carry 4 hrs response time ie. the call need to be attended within 4hrs.
If the call is attended after 4hrs from the logged time then it becomes response time tail (RTTAIL)
Now my data is like in one column all these products are present(GroupA,GroupB) and in one column the response time(RT) is present.
And i need to check for the group column for the product say DC12 and RT column for response time. As per above DC12 carries 4 hrs response time.
so if that RT value is less than or equal to 4hrs then Not a Tail,
if RT value is greater than 4hrs then it is Tail.
I wanted to use a formula like =RTTAIL(GroupColumn,RTValue)
finally if the RT column is blank then function should return Blank Data
Hope this makes things clear.
I also tired to edit your function but i gave me #Name? error
Please find the edited one below
[VBA]
Function RTTAIL(Group As Range, RT As Range) As String
GroupA = Array("SFIDA", "MALTA", "DP180F")
GroupB = Array("DC12", "FUJHIN", "OLYMPIA", "XES PSG")
For Each thing In GroupA
If thing = Group.Value And RT.Value > 2 Then
RTTAIL = "Tail"
Exit Function
End If
Next thing
For Each thing In GroupB
If thing = Group.Value And RT.Value > 4 Then
RTTAIL = "Tail"
Exit Function
End If
Next thing
For Each thing In GroupA
If thing = Group.Value And RT.Value <= 2 Then
RTTAIL = "Not a Tail"
Exit Function
End If
Next thing
For Each thing In GroupB
If thing = Group.Value And RT.Value <= 4 Then
RTTAIL = "Not a Tail"
Exit Function
End If
Next thing
If IsEmpty(RT) Then RTTAIL = "Blank data"
End Function
[/VBA]
Kindly help to resolve
Thanks
Raj
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules