title: New computed column replicating SUMIFS from excel
body: <p>I have a data frame (df) as follows:</p>
  
  <pre><code>&gt;date       fx      mkt_val
  &gt;03/01/2016 AUD     50
  &gt;03/01/2016 AUD     75
  &gt;03/01/2016 USD     100
  &gt;03/01/2016 USD     150
  &gt;03/02/2016 AUD     50
  &gt;03/02/2016 AUD     500
  &gt;03/02/2016 USD     150
  &gt;03/02/2016 USD     275
  </code></pre>
  
  <p>I want to be able effectively replicate the SUMIFS function in excel, so that I get a new column that contains the sum of each fx value for each date. Such that the output would look as follows:</p>
  
  <pre><code>&gt;date       fx  mkt_val sumifs
  &gt;03/01/2016 AUD   50    125
  &gt;03/01/2016 AUD   75    125
  &gt;03/01/2016 USD   100   250
  &gt;03/01/2016 USD   150   250
  &gt;03/02/2016 AUD   50    550
  &gt;03/02/2016 AUD   500   550
  &gt;03/02/2016 USD   150   425
  &gt;03/02/2016 USD   275   425
  </code></pre>
  
  <p>Any points to the right direction or code would help! Thank you.</p>