title: Google Sheets SUMIFS comparing one column to another
body: <p>I am wondering if there is a way to use column comparisons in a SUMIF or SUMIFS function or the DSUM function even. Specifically, I want to compare one value in a row with another value in the same row of data.</p>
  <p>For example, let's say I have the following table of data:</p>
  <p>Date 1   |   Date 2   |  Money Earned <br>
  1/2/22   |   1/5/22   |  $23.00 <br>
  1/5/22   |   1/3/22   |  $11.00 <br></p>
  <p>I want to write a formula that sums the values in the 3rd column if Date 1 is last week and if Date 2 is later than or equal to Date 1.</p>
  <p>I have completed a workaround solution with 2 hidden columns as follows:<br>
  <strong>Last week</strong> --&gt; =IF(EQ(WEEKNUM(TODAY()) - WEEKNUM(A2), 1), &quot;YES&quot;, &quot;NO&quot;)<br>
  <strong>Date 2 After Date 1</strong> --&gt; =IF(B2&gt;=A2, &quot;YES&quot;, &quot;NO&quot;)<br></p>
  <p>Then I use:<br>
  =SUMIFS(C2:C3,D2:D3,&quot;YES&quot;,E2:E3,&quot;YES&quot;)<br></p>
  <p>It all works, but I am trying to learn to do this a cleaner way without hidden columns that someone might move or delete.</p>
  <p>All the examples I can find of SUM or SUMIF rely on the criteria being compared to a singular value that is either hardcoded in the formula or the value of a single cell. I want to compare data from column 1 to column 2 directly for each row. Is this possible with these formulas or any formula in Google Sheets?</p>