How do I write this UDF with the help of 'case' function?
Function AgingBucket(Age As Integer) As String
If Age >= 120 Then
AgingBucket = "120 Days"
ElseIf Age >= 90 Then
AgingBucket = "90 Days"
ElseIf Age >= 60 Then
AgingBucket = "60 Days"
ElseIf Age >= 30 Then
AgingBucket = "30 Days"
ElseIf Age < 30 Then
AgingBucket = "Current"
End If
End Function
With Regards
Rudra
Function AgingBucket(Age As Integer) As String
If Age >= 120 Then
AgingBucket = "120 Days"
ElseIf Age >= 90 Then
AgingBucket = "90 Days"
ElseIf Age >= 60 Then
AgingBucket = "60 Days"
ElseIf Age >= 30 Then
AgingBucket = "30 Days"
ElseIf Age < 30 Then
AgingBucket = "Current"
End If
End Function
With Regards
Rudra