总和Excel不同的值 [英] Sum Excel Distinct Values

查看:87
本文介绍了总和Excel不同的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用MySQL,但是在MS Excel中如何(甚至是可能的话)也是如此。我在Windows上运行Excel版本14(Office Professional 2010的一部分)。



我有一个包含两列的表,例如一个包含电话号码,另一个包含整数(电话长度)。每个电话号码有多个来电,所以这些号码可能会出现多次。我正在尝试SUM每个不同电话号码的总分钟数。如何在Excel中执行此操作?

  ------------------ ------- 
|数字|持续时间|
-------------------------
| 1234567 | 8 |
| 2345671 | 5 |
| 1234567 | 12 |
| 3456712 | 5 |
| 3456712 | 47 |
| 1234567 | 15 |
| 1234567 | 4 |
-------------------------

所以最终结果将是这样的:

  --------- ---------------- 
|数字|持续时间|
-------------------------
| 1234567 | 39 |
| 2345671 | 5 |
| 3456712 | 52 |
-------------------------

谢谢!

解决方案

这里是如何使用数据透视表来实现的。



我刚刚创建了一个20秒屏幕截图 here


I know how to do this with MySQL, but am at a loss as to how (or even if possible) within MS Excel. I am running Excel version 14 on Windows (part of Office Professional 2010).

I have a table with two columns...for example one containing phone numbers and the other containing integers (length of phone calls). There are multiple calls from each phone number, so those numbers would likely appear multiple times. I am trying to SUM the total number of minutes per distinct phone number. How can I do this in Excel?

-------------------------
|  number  |  duration  |
-------------------------
| 1234567  |  8         |
| 2345671  |  5         |
| 1234567  |  12        |
| 3456712  |  5         |
| 3456712  |  47        |
| 1234567  |  15        |
| 1234567  |  4         |
-------------------------

So the end result would be something like:

-------------------------
|  number  |  duration  |
-------------------------
| 1234567  |  39        |
| 2345671  |  5         |
| 3456712  |  52        |
-------------------------

Thanks!

解决方案

Here is how to achieve this using pivot table.

I just created a 20 seconds screencast here.

这篇关于总和Excel不同的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆