如何将通过比较日期和公司找到的数字相加?

如何将通过比较日期和公司找到的数字相加?

示例截图

+-----------+---------+---------+--+--+
| Date      | Company | Payment |  |  |
+-----------+---------+---------+--+--+
| 1/15/2016 | Acme    | $128.00 |  |  |
+-----------+---------+---------+--+--+
| 1/14/2016 | Pixar   | $72.60  |  |  |
+-----------+---------+---------+--+--+
| 5/14/2015 | NBA     | $410.85 |  |  |
+-----------+---------+---------+--+--+
| 5/14/2015 | Uber    | $217.30 |  |  |
+-----------+---------+---------+--+--+
| 5/13/2015 | Acme    | $132.00 |  |  |
+-----------+---------+---------+--+--+
| 5/13/2015 | Acme    | $290.40 |  |  |
+-----------+---------+---------+--+--+
| 5/10/2015 | NBA     | $537.60 |  |  |
+-----------+---------+---------+--+--+
| 5/10/2015 | Acme    | $355.58 |  |  |
+-----------+---------+---------+--+--+
| 5/8/2015  | Acme    | $103.13 |  |  |
+-----------+---------+---------+--+--+
| 5/7/2015  | NBA     | $115.00 |  |  |
+-----------+---------+---------+--+--+
| 5/7/2015  | Uber    | $211.20 |  |  |
+-----------+---------+---------+--+--+
| 5/5/2015  | Acme    | $412.50 |  |  |
+-----------+---------+---------+--+--+
| 5/5/2015  | Uber    | $275.00 |  |  |
+-----------+---------+---------+--+--+
| 5/5/2015  | NBA     | $128.00 |  |  |
+-----------+---------+---------+--+--+
| 4/30/2015 | NBA     | $72.60  |  |  |
+-----------+---------+---------+--+--+
| 4/30/2015 | Acme    | $410.85 |  |  |
+-----------+---------+---------+--+--+
| 4/30/2015 | Acme    | $217.30 |  |  |
+-----------+---------+---------+--+--+
| 4/29/2015 | Uber    | $132.00 |  |  |
+-----------+---------+---------+--+--+
| 4/29/2015 | Pixar   | $290.40 |  |  |
+-----------+---------+---------+--+--+
| 4/27/2015 | Uber    | $537.60 |  |  |
+-----------+---------+---------+--+--+
| 4/27/2015 | Acme    | $355.58 |  |  |
+-----------+---------+---------+--+--+

我需要将每个公司每个月的付款加起来(数据分布在 2 年内)。因此,对于此示例,我需要使用 Excel 查找 Acme 在 5 月份付款的时间,并将所有这些付款加起来。其他的也一样。我有点缺乏经验,过去找不到有人这样做的好例子。

输出需要在不同的工作表中,理想情况下组织如下:

+------+----------------+------+-----------------+  
| Acme | January        | 2015 |  $ 110.00       |  
+------+----------------+------+-----------------+  
| Acme | February       | 2015 |  $   35.00      |  
+------+----------------+------+-----------------+  
| Acme | March          | 2015 |  $   33.00      |  
+------+----------------+------+-----------------+  
| Acme | April          | 2015 |  $          -   |  
+------+----------------+------+-----------------+  
| Acme | May            | 2015 |                 |  
+------+----------------+------+-----------------+  
| Acme | June           | 2015 |                 |  
+------+----------------+------+-----------------+  
| Acme | July           | 2015 |                 |  
+------+----------------+------+-----------------+  
| Acme | August         | 2015 |                 |  
+------+----------------+------+-----------------+  
| Acme | September      | 2015 |                 |  
+------+----------------+------+-----------------+  
| Acme | October        | 2015 |                 |  
+------+----------------+------+-----------------+  
| Acme | November       | 2015 |                 |  
+------+----------------+------+-----------------+  
| Acme | December       | 2015 |                 |  
+------+----------------+------+-----------------+  
| Acme | TOTAL for 2015 |      |                 |  
+------+----------------+------+-----------------+  
| Acme | January        | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | February       | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | March          | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | April          | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | May            | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | June           | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | July           | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | August         | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | September      | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | October        | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | November       | 2016 |                 |  
+------+----------------+------+-----------------+  
| Acme | December       | 2016 |                 |   
+------+----------------+------+-----------------+  
| Acme | TOTAL for 2016 |      |                 |  
+------+----------------+------+-----------------+  

答案1

您没有提供任何有关结果外观的信息。但有一种可能性是使用数据透视表。

  • 将日期拖到行区域
  • 公司至专栏区
  • 支付价值区
  • 按年份和月份对日期进行分组
  • 按您喜欢的格式。

以下是这些结果的一个例子

在此处输入图片描述

您已编辑帖子以显示您想要的输出。如果您将公司拖到行区域,并安排公司位于该列表中的第一个,则输出将接近您显示的内容:

在此处输入图片描述

并且可以通过“设计”选项卡轻松删除小计和总计

在此处输入图片描述

如果这是一项不频繁的任务,您可以轻松地手动完成。如果这是需要每天做几次的事情,如果您熟悉 VBA,宏可能是更好的选择。

相关内容