Check one list against another

itrisk

New Member
Joined
Mar 29, 2018
Messages
4
Hello,

Please help...

I need to test a list of items against a set of rules as follows:

List
UserSystem Roles
JohnRole 1
JohnRole 2
JohnRole 3
JohnRole 4

<tbody>
</tbody>










Rules
RuleSystem RolesSystem Roles
Rule 1Role 1Role 2
Rule 2Role 3Role 4
Rule 3Role 1Role 3
Rule 4Role 2Role 3

<tbody>
</tbody>


What I need to check:
If the user "John" has those 4 roles, which rules does he break?

So, in this case "John" breaks all for 4 rules as his 4 roles break the different combinations.

So the output could look like:
UserRules broken
John1
John2
John3
John4

<tbody>
</tbody>


Background: This would be used to see if a user's access would be in violation of a rule set that is made up of combinations of system roles a single user shouldn't have...


Any help would be appreciated!

Many thanks
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hello itrisk

How many rules must a user violate to be denied access? I think what you can do is have a counter, and if this counter reaches a certain value then access will be denied.

So, if I violate rule 1 I’ll have a 1 in my counter, if I violate rules 1 and 2 then I will have 3 in my counter. The permutations and/or combinations of a set of 4 elements is not that many, so this can be done easily.

Hope this helps.
 
Upvote 0
It would be easier if the final report table could be organised by user like this:


Book1
AB
1UserSystem Role
2JohnRole 1
3JohnRole 2
4JohnRole 3
5JohnRole 4
Roles



Book1
ABC
1RuleSystem RoleSystem Role
2Rule 1Role 1Role 2
3Rule 2Role 3Role 4
4Rule 3Role 1Role 3
5Rule 4Role 2Role 3
Rules



Book1
ABCDE
1UserRule 1Rule 2Rule 3Rule 4
2JohnBrokenBrokenBrokenBroken
Check
Cell Formulas
RangeFormula
B2=IF(COUNTIFS(Roles!$A:$A,$A2,Roles!$B:$B,INDEX(Rules!$B:$B,MATCH(B$1,Rules!$A:$A,0)))+COUNTIFS(Roles!$A:$A,$A2,Roles!$B:$B,INDEX(Rules!$C:$C,MATCH(B$1,Rules!$A:$A,0)))>1,"Broken","")


Copy B2 formula across and down. Is that an acceptable compromise?

WBD
 
Upvote 0
Hi WBD,

That is an acceptable compromise!:)

But would this work for a list of multiple users?

Thanks
 
Upvote 0

Forum statistics

Threads
1,213,524
Messages
6,114,117
Members
448,549
Latest member
brianhfield

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top