=IF(OR(A2<15000, C2<=0), 0, IF(C2< 0.05, 1, IF(AND(A2<1250000, C2<0.1), 2, IF(AND(A2>=50000,A2<125000), 4, 3))))
Function YE_YE(r As Range) As Integer
Select Case True
Case r(1) < 15000
YE_YE = 0
Case r(1) >= 15000 & r(1) < 50000
Select Case True
Case r(2) <= 0
YE_YE = 0
Case r(2) > 0 And r(2) < 5
YE_YE = 1
Case r(2) >= 5 And r(2) < 10
YE_YE = 2
Case r(2) >= 10
YE_YE = 3
End Select
Case r(1) >= 50000 & r(1) < 125000
Select Case True
Case r(2) <= 0
YE_YE = 0
Case r(2) > 0 And r(2) < 5
YE_YE = 1
Case r(2) >= 5 And r(2) < 10
YE_YE = 2
Case r(2) >= 10
YE_YE = 4
End Select
Case r(1) >= 1250000
Select Case True
Case r(2) <= 0
YE_YE = 0
Case r(2) > 0 And r(2) < 5
YE_YE = 1
Case r(2) >= 5
YE_YE = 3
End Select
End Select
End Function
Function YE_YE(rA As Range, rC) As Integer
Select Case True
Case rA < 15000
YE_YE = 0
Case rA >= 15000 And rA < 50000
Select Case True
Case rC <= 0
YE_YE = 0
Case rC > 0 And rC < 5
YE_YE = 1
Case rC >= 5 And rC < 10
YE_YE = 2
Case rC >= 10
YE_YE = 3
End Select
Case rA >= 50000 And rA < 125000
Select Case True
Case rC <= 0
YE_YE = 0
Case rC > 0 And rC < 5
YE_YE = 1
Case rC >= 5 And rC < 10
YE_YE = 2
Case rC >= 10
YE_YE = 4
End Select
Case rA >= 1250000
Select Case True
Case rC <= 0
YE_YE = 0
Case rC > 0 And rC < 5
YE_YE = 1
Case rC >= 5
YE_YE = 3
End Select
End Select
End Function
=IF(A1<15000,0,MIN(IF(B1<=0,0,IF(AND(A1>0,B1<5),1,IF(AND(B1>=5,A1<=10),2,IF(A1>=10,3,0)))),IF(A1>1250000,2,3)))
Regards
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.