Hi,
I am quite new to Excel and need help with the following problem:
I have three worksheets:
ROLE (worksheet 1) - contains ID number (cells A2:A13) and NAME (cells B2:B13)
PERMISSION (worksheet 2) - contains ID number (cells A2:A16) and NAME (cells B2:B16)
ROLE_PERMISSION (worksheet 3) - contains ROLE ID (cells A2:A28) and PERMISSION ID (cells C2:C28), and empty cells (where formulae are called from) for ROLE NAME (B2:B28) and PERMISSION NAME (D2:D28)
What I want to do is have formula in worksheet 3 which looks up ROLE ID from worksheet 1 and enters the ROLE NAME, then look up PERMISSION ID from the worksheet 2 and enter the PERMISSION NAME.
I have a rough working solution but only returns "No Match Found" where the ID is 0. All other non-valid IDs return the first NAME in the list.
{=IFERROR(INDEX(ROLE!$B$2:$B$14,MIN(IF(A2=ROLE!$A$2:$A$104,ROW(ROLE!$A$1:$B$13)))),"No match found.")}
{=IFERROR(INDEX(PERMISSION!$B$2:$B$50,MIN(IF(C6=PERMISSION!$A$2:$A$50,ROW(PERMISSION!$A$1:$B$40)))),"No match found.")}
These formulae output the below results into worksheet 3:
<tbody>
</tbody>
I cobbled together this solution by looking online so I don't fully understand what it's doing. Ideally I want it to work for any number of values since this will be a template for varying volumes of data. Can anyone help? Is this something best done via a macro (which I'd also need help with)?
Thanks very much in advance
I am quite new to Excel and need help with the following problem:
I have three worksheets:
ROLE (worksheet 1) - contains ID number (cells A2:A13) and NAME (cells B2:B13)
PERMISSION (worksheet 2) - contains ID number (cells A2:A16) and NAME (cells B2:B16)
ROLE_PERMISSION (worksheet 3) - contains ROLE ID (cells A2:A28) and PERMISSION ID (cells C2:C28), and empty cells (where formulae are called from) for ROLE NAME (B2:B28) and PERMISSION NAME (D2:D28)
What I want to do is have formula in worksheet 3 which looks up ROLE ID from worksheet 1 and enters the ROLE NAME, then look up PERMISSION ID from the worksheet 2 and enter the PERMISSION NAME.
I have a rough working solution but only returns "No Match Found" where the ID is 0. All other non-valid IDs return the first NAME in the list.
{=IFERROR(INDEX(ROLE!$B$2:$B$14,MIN(IF(A2=ROLE!$A$2:$A$104,ROW(ROLE!$A$1:$B$13)))),"No match found.")}
{=IFERROR(INDEX(PERMISSION!$B$2:$B$50,MIN(IF(C6=PERMISSION!$A$2:$A$50,ROW(PERMISSION!$A$1:$B$40)))),"No match found.")}
These formulae output the below results into worksheet 3:
ROLE ID | ROLE NAME | PERMISSION ID | PERMISSION NAME |
1 | Role 1 | 1 | Permission 1 |
2 | Role 2 | 2 | Permission 2 |
3 | Role 3 | 3 | Permission 3 |
4 | Role 4 | 4 | Permission 4 |
5 | Role 5 | 5 | Permission 5 |
6 | Role 6 | 6 | Permission 6 |
7 | Role 7 | 7 | Permission 7 |
8 | Role 8 | 8 | Permission 8 |
9 | Role 9 | 9 | Permission 9 |
10 | Role 10 | 10 | Permission 10 |
11 | Role 11 | 11 | Permission 11 |
12 | Role 12 | 12 | Permission 12 |
13 | Role 1 | 13 | Permission 13 |
14 | Role 1 | 14 | Permission 14 |
15 | Role 1 | 15 | Permission 15 |
1 | Role 1 | 16 | Permission 1 |
2 | Role 2 | 17 | Permission 1 |
0 | No match found. | 18 | Permission 1 |
4 | Role 4 | 19 | Permission 1 |
5 | Role 5 | 20 | Permission 1 |
1 | Role 1 | 0 | No match found. |
6 | Role 6 | 1 | Permission 1 |
7 | Role 7 | 2 | Permission 2 |
8 | Role 8 | 3 | Permission 3 |
11 | Role 11 | 4 | Permission 4 |
13 | Role 1 | 5 | Permission 5 |
15 | Role 1 | 6 | Permission 6 |
<tbody>
</tbody>
I cobbled together this solution by looking online so I don't fully understand what it's doing. Ideally I want it to work for any number of values since this will be a template for varying volumes of data. Can anyone help? Is this something best done via a macro (which I'd also need help with)?
Thanks very much in advance