English 中文(简体)
如何将映射的数值添加到类似字符串中
原标题:How to add numerical values mapped to similar strings
  • 时间:2012-05-25 19:09:29
  •  标签:
  • excel
  • vba

我向Excel扔了一个SQL查询 正在寻找实现自动化的方法

我这里有的就是这个

site                             12
site/subsite                     22
another site                     77
another site/subsite             16

我的问题是:在Excel中,有没有办法为网站及其相关子站点增加总数?我有大约4000行,所以想节省体力劳动。

最佳回答

使用 SUMIF () 函数 。

举例来说,

将数据放入 A 和 B 栏( A 中的位置, B 中的值)。

在单元格 D1 中添加一列标题, 与其中一个站点的名称完全吻合 。

在单元格 D2 中添加此公式:

=SUMIF($A6:$B17, D1, $B6:$B17)

修改起始行和结尾行以覆盖您的全部数据集。 (以我设置的示例为例,数据在第6至17行)

您可以列出所有站点和子站点, 并使用公式引用数据区域来计算每个站点和子站点的总和。

问题回答

暂无回答




相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签