title: Sum of first rows of the year in Excel
body: <p>How to achieve such a result in column C?</p>
  <p><a href="https://i.stack.imgur.com/Mv1ym.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mv1ym.png" alt="What I want in Excel" /></a></p>
  <p>The column C should automatically determine first row in a year by column &quot;A&quot;, take a corresponding value from column &quot;B&quot; and then in each row of column &quot;C&quot; make a sum only of those first-in-a-year entries of column &quot;B&quot; as listed.</p>
  <p>I am stuck at the following step:</p>
  <pre><code>=MIN(A1:A23-DATE(YEAR(A3);1;1))
  </code></pre>
  <p>Here is the data in text form to help reproducing the case:</p>
  <pre><code>23.01.2018 19:04    7000
  07.06.2018 17:38    7000
  08.06.2018 19:59    7000
  06.09.2018 20:20    7000
  19.10.2018 21:42    7000
  15.11.2018 17:21    7000
  16.11.2018 19:04    7000
  20.11.2018 17:56    7000
  09.12.2018 23:25    7000
  01.01.2019 20:44    12000
  10.03.2019 21:20    12000
  24.06.2019 17:46    12000
  05.07.2019 19:40    12000
  28.08.2019 18:03    12000
  27.09.2019 16:46    12000
  01.11.2019 17:15    12000
  11.11.2019 20:03    12000
  24.01.2020 18:49    12000
  13.03.2020 18:37    12000
  24.04.2020 17:41    12000
  06.05.2020 19:09    12000
  07.10.2020 21:20    12000
  04.12.2021 17:17    12000
  </code></pre>