title: How to Join Multiple Reference Tables Based on a String
body: <p>Suppose that I am given three sheets to pull data from and I need to get repeating data back from those sheets. Essentially for each user in a user group, find all the permissions associated from another group and display given permissions. My sheets are setup as such. <strong>(Assume top left is A1)</strong></p>
  
  <h3>First Table (User Sheet)</h3>
  
  <pre><code>Username    Group
  GPARR11     ACC-ADMIN
  LPARR11     PRT-MGR
  CSMITH      VP-SALES
  </code></pre>
  
  <h3>Second Table (Permissions Sheet)</h3>
  
  <pre><code>Group       Ref Table Rows  Switches
  ACC-ADMIN   500             YNYNNNYN
  ACC-ADMIN   502             YNYYY
  ACC-ADMIN   503             NYNYYN
  PRT-MGR     500             NNNYNNNYN
  PRT-MGR     633             YNYNNNYNNY
  VP-Sales    500             NYNYNNNYNY
  VP-Sales    999             NYNYNYNYNYNNYNNYNYNN
  </code></pre>
  
  <h3>Final Table (Reference Sheet)</h3>
  
  <p><em>This sheet get's it's reference from the third column in the second sheet. So if a character is <code>Y</code> then it has that permission enabled <code>N</code> then it doesn't.</em></p>
  
  <pre><code>Ref Table Switch Row    Sequenc #   Permission
  500                        1        Access G&amp;B
  500                        2        Access Call
  500                        3        Access A/R
  633                        1        Modify G&amp;B
  633                        2        Modify Call
  633                        3        Modify Memos
  999                        1        Delete G&amp;B
  </code></pre>
  
  <h3>What I'm expecting to see</h3>
  
  <pre><code>Username    Group       Permission    Enabled
  GPARR11     ACC-ADMIN   Access G&amp;B    TRUE
                          Access Call   FALSE
                          Access A/R    TRUE
  
  LPARR11     PRT-MGR     Access G&amp;B    FALSE
                          Access Call   FALSE
                          Access A/R    FALSE
                          Modify G&amp;B    TRUE
                          Modify Call   FALSE
                          Modify Memos  TRUE
  
  CSMITH38    VP-SALES    Access G&amp;B    FALSE
                          Access Call   TRUE
                          Access A/R    FALSE
  </code></pre>
  
  <h3>ADDT'L Info</h3>
  
  <p>Essentially the way that the information is supposed to flow to get each of the expected outputs is as follows. For each Username match their group name with the group name in the second sheet. From there the <code>Ref Table Rows</code> would tell you which rows are allowed to be returned, mapping the <code>Switches</code> <code>(YNYNYN)</code> with the respective Ref Table Rows from the reference sheet. The sequence number is there to determine which permission matches with the respective Switch. 1 is first char, 2 the second char, etc.. and determines whether it returns true or false on the output.</p>
  
  <p>Looking at <code>GPARR11</code> the <code>ACC-ADMIN</code> matches with <code>ACC-ADMIN</code> in the permissions table. There are three <code>Ref Table Rows</code> associated with <code>ACC-ADMIN</code>, <code>500</code>, <code>502</code>, <code>503</code>. Each row has <code>Switches</code> that correspond to the <code>Reference Table</code>. So it will pull ALL permissions from <code>500</code>, <code>502</code>, <code>503</code>, and then check the <code>switch</code> to determine if each permission from the <code>ref rows</code> is <code>TRUE</code> or <code>FALSE</code> </p>
  
  <p>Is there a way that this can be done with a formula?</p>