title: Ammending Equation so that columns A,B do not have to be adjacent to eachother
body: <p>I have this formula below which sorts data In columns A and B as shown in the image.</p>
  <p><a href="https://i.stack.imgur.com/NGmuK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NGmuK.png" alt="enter image description here" /></a></p>
  <p>The formula is:
  <code>=SUBSTITUTE(FILTERXML(&quot;&lt;t&gt;&lt;s&gt;&quot;&amp;TEXTJOIN(&quot;&lt;/s&gt;&lt;s&gt;'&quot;,,A2:B60)&amp;&quot;&lt;/s&gt;&lt;/t&gt;&quot;,&quot;//s&quot;),&quot;'&quot;,&quot;&quot;)</code>.</p>
  <p>The problem with this question however is that it requires Columns A and B to be adjacent to each other.</p>
  <p>Gary Student provided me with the above and an alternative solution that enables the same affect without the columns being adjacent, but this requires a LET function. For those interested this solution is: <code>=LET(x,INDEX(A$2:E$22,ROUNDUP(SEQUENCE(42)/2,0),IF(MOD(SEQUENCE(42),2)=0,5,1)),FILTER(x,x&lt;&gt;&quot;&quot;))</code>.</p>
  <p>For whatever reason however my work computer despite having excel 365 does not have the LET function and I am unable to update it.</p>
  <p>I was wondering if anyone knew how to amend this formula so that columns A and B don't have to be Adjacent.</p>