title: Excel version of QlikView 'aggr' function
body: <p>I wonder if you can help me. I’m working with Excel 365 (with the Power BI plugins).</p>
  
  <p>I have what seems to be a simple problem to solve but through all my googling I have not found an answer.</p>
  
  <p>My outcome is to show how many times an ‘X’ has been to a given location.
   </p>
  
  <pre><code>Location table (this is a pivot table)
  Locations   Visits
  
  X1      2
  X2      2
  X3      2
  X4      2
  X5      2
  X6      2
  X7      2
  X8      2
  X9      2
  X10     2
  X11     2
  X12     2
  X13     2
  X14     2
  X15     2
  X16     2
  X17     2
  X18     2
  X19     2
  X20     2
  X21     2
  X22     2
  X23     2
  X24     2
  X25     4
   
  </code></pre>
  
  <p> 
  I would like to turn the data in the ‘Location table’ into the ‘Times Visited’ table below
   </p>
  
  <pre><code>Times Visited table
  Times visited   count
  2                 24
  4                 1
  </code></pre>
  
  <p> 
  I created this table by counting how many times ‘2’ and ‘4’ appears in the ‘Location table’
   </p>
  
  <pre><code>This shows that:
  2 appears 24 times (i.e. 24 X’s have been to ‘Location 1’ two times)
  4 appear once (i.e. 1 X has been to ‘Location 1’ four times)
  </code></pre>
  
  <p> 
  This is easily solved using QlikView but is proving difficult for me to do in excel 2013. In QlikView I can use a function called ‘aggr’.
   
  Do you have any ideas how I can solve this in excel 2013?</p>