根据最大日期和唯一范围对一列求和

Sum a column based on max date and unique range

基本上,试图弄清楚如何根据 latest/max 日期按城镇对总计列求和,即按每行的唯一日期和最新日期过滤。

Date Town Totals
September 5 Loerie 9
November 8 Loerie 4
May 7 Flower 2
February 2 Holo 8
May 9 Holo 7
July 23 Flower 3
June 7 Dump 1
March 3 Tzaneen 9
September 2 Tzaneen 4
April 3 Coffee 7

能够对城镇列表进行唯一排序,并使用 =maxifs(C$2:C,B$2:B,F2,A$2:A,maxifs(A$2:A) 根据最大​​日期显示每个城镇列表的总数,B$2:B,F2))

需要能够在单个函数中对这些结果进行排序和求和,但不确定如何操作。数组公式? 共享示例文档。 https://docs.google.com/spreadsheets/d/1SSNJJOoz1-pxVH0ZoFFZqChhZxjqtRz5dfvyQu76ueI/edit?usp=sharing

尝试:

=QUERY(SORTN(SORT(A2:C, 2, 1, 1, 0), 9^9, 2, 2, 1), "select Col2,Col3")

total:

={QUERY(SORTN(SORT(A2:C, 2, 1, 1, 0), 9^9, 2, 2, 1), "select Col2,Col3"); 
 "Total:", SUM(INDEX(SORTN(SORT(A2:C, 2, 1, 1, 0), 9^9, 2, 2, 1),,3))}

total:

=SUM(INDEX(SORTN(SORT(A2:C, 2, 1, 1, 0), 9^9, 2, 2, 1),,3))