In an Excel Workbook, Sheet1, I have authority matrix defined:
Sheet1 4 columns with sample values:
Min Perc Max Perc Authorizer Amount
1 25 Incharge 10,000
26 50 GM 20,000
Explanation of values:
An incharge can approve from 1% to 25% of the Bill Amount or 10,000 whichever is lower
GM can approve from 26% to 50% of the Bill Amount or 20,000 whichever is lower
Now in Sheet2, I have the actual data and I need to check the compliance of this policy.
In Sheet2, Column A, I have Bill Amount.
In Sheet2, Column B, I have Percentage.
So, first 3 columns with sample values:
Bill Amount Percentage Amount
5,000 10 500
10,000 20 2,000
30,000 60 18,000
35,000 70 24,500
40,000 80 32,000
Now, to check the compliance, I created a column D, named Authorizer.
Formula in cell D2:
=VLOOKUP(B2,Sheet1!$A$1:$C$3,3,TRUE)
Value in cell D2:
Incharge
Then I created a column E, named Minimum Allowed Amount.
Formula in cell E2:
=MIN(C2,VLOOKUP(D2,Sheet1!$C$1:$D$3,2,FALSE))
Value in cell E2:
500
And finally I created a column F, Named Compliance.
Formula in cell F2:
=IF(AND(D2="Incharge",B2>25,C2>E2),"Non-Compliance",IF(AND(D2="GM",B2>50,C2>E2),"Non-Compliance","Compliance"))
This fulfilled the requirement. But in the IF formula, I had to hard-code authorizer names,maximum percentage and also the formula will become too lengthy as the number of authorizers increase.
Sheet1 4 columns with sample values:
Min Perc Max Perc Authorizer Amount
1 25 Incharge 10,000
26 50 GM 20,000
Explanation of values:
An incharge can approve from 1% to 25% of the Bill Amount or 10,000 whichever is lower
GM can approve from 26% to 50% of the Bill Amount or 20,000 whichever is lower
Now in Sheet2, I have the actual data and I need to check the compliance of this policy.
In Sheet2, Column A, I have Bill Amount.
In Sheet2, Column B, I have Percentage.
So, first 3 columns with sample values:
Bill Amount Percentage Amount
5,000 10 500
10,000 20 2,000
30,000 60 18,000
35,000 70 24,500
40,000 80 32,000
Now, to check the compliance, I created a column D, named Authorizer.
Formula in cell D2:
=VLOOKUP(B2,Sheet1!$A$1:$C$3,3,TRUE)
Value in cell D2:
Incharge
Then I created a column E, named Minimum Allowed Amount.
Formula in cell E2:
=MIN(C2,VLOOKUP(D2,Sheet1!$C$1:$D$3,2,FALSE))
Value in cell E2:
500
And finally I created a column F, Named Compliance.
Formula in cell F2:
=IF(AND(D2="Incharge",B2>25,C2>E2),"Non-Compliance",IF(AND(D2="GM",B2>50,C2>E2),"Non-Compliance","Compliance"))
This fulfilled the requirement. But in the IF formula, I had to hard-code authorizer names,maximum percentage and also the formula will become too lengthy as the number of authorizers increase.