Home > OS >  How to return the highest sum of a dataset according to a set date range?
How to return the highest sum of a dataset according to a set date range?

Time:07-09

I have a column with different dates and another column with a series of expenses associated to the dates. I can have several expenses on the same date. I want it to return the date on which there has been the highest sum of expenses of the whole range of dates as well as the sum of these expenses, i.e. I want to know on which date there was the highest expense of the whole series but without including 01/07/2022 when making the calculations. So far I have managed to apply a formula that returns in E2 the day with the highest expenses (in this case 03/07/2022) but I cannot get the sum of the expenses for 03/07/2022 in E3.

=INDEX($A$8:$A$11;MATCH(MAX(SUMIF($B$8:$B$11;$B$8:$B$11));SUMIF($B$8:$B$11;$B$8:$B$11);0))

see the picture attached

CodePudding user response:

try in E3:

=SUMPRODUCT(FILTER(B:B; A:A=E2))
  • Related