Help with cell value replacement across multiple worksheets

Alma1219

New Member
Joined
Jun 25, 2012
Messages
1
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:

ROLE IDROLE NAMEPERMISSION IDPERMISSION NAME
1Role 11Permission 1
2Role 22Permission 2
3Role 33Permission 3
4Role 44Permission 4
5Role 55Permission 5
6Role 66Permission 6
7Role 77Permission 7
8Role 88Permission 8
9Role 99Permission 9
10Role 1010Permission 10
11Role 1111Permission 11
12Role 1212Permission 12
13Role 113Permission 13
14Role 114Permission 14
15Role 115Permission 15
1Role 116Permission 1
2Role 217Permission 1
0No match found.18Permission 1
4Role 419Permission 1
5Role 520Permission 1
1Role 10No match found.
6Role 61Permission 1
7Role 72Permission 2
8Role 83Permission 3
11Role 114Permission 4
13Role 15Permission 5
15Role 16Permission 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
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

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