title: Pulling Unique Values from Multiple Columns
body: <p>So I'm working on automating my budgeting spreadsheets with a little automation. For each expense there is a category and then a description of the expense so for example:</p>
  
  <p><a href="https://i.stack.imgur.com/DfqCf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DfqCf.png" alt="Spreadsheet Rough Draft"></a></p>
  
  <p>What I want to do is on the far right for the total is tally up everything for each category, but I want to populate that list on the fly, so for the category column I want it to look at all the category columns and list out unique categories, so even though I might have 'Grocery' listed twice during the week, it only shows up once in the Total Section. The price column would then be the total of that category spent that week.</p>
  
  <p>The issue I'm having is pulling unique values from multiple columns. The closest I've found is this:</p>
  
  <pre><code>=INDIRECT(TEXT(MIN(IF(($A$2:$C$9&lt;&gt;"")*(COUNTIF($E$1:E1,$A$2:$C$9)=0),ROW($2:$9)*100+COLUMN($A:$C),7^8)),"R0C00"),)&amp;""
  </code></pre>
  
  <p>It works great if the columns I'm looking at are all next to each other, but the columns I'm using are split up. I can't seem to get it to work with the columns broken up.</p>
  
  <p>My attempt:</p>
  
  <pre><code>=INDIRECT(TEXT(MIN(IF((($B$3:$B$35,$E$3:$E$35)&lt;&gt;"")*(COUNTIF($Q$2:Q2,($B$3:$B$35,$E$3:$E$35))=0),ROW($3:$35)*100+COLUMN($B:$B)+COLUMN($E:$E),7^8)),"R0C00"),)&amp;""
  </code></pre>
  
  <p>All I get is 'Error in Value'</p>
  
  <p>Any advice is greatly appreciated. Thanks!</p>