简体   繁体   English

根据另一列中的值求和一列中的值-Excel 2013

[英]Sum the value in one column based on the value in another column - excel 2013

I have 3 Columns, B,C and D. 我有3列,B,C和D。

Columns B,C,D will be updated periodically and the number of rows will be increased day by day. B,C,D列将定期更新,并且行数将每天增加。

Columns B contains NAME, C contains Quantity and D has Date value. 列B包含名称,列C包含数量,列D具有日期值。

Name Qt Date
SSS 20  
SSS 30  
NNN 50  
PPP 40  13-Jul-15
PPP 20  13-Jul-15
AAA 20  
CCC 100 
GGG 300 
FFF 200 
BBB 50  28-Aug-15
AAA 20  
GGG 100 
BBB 30  
JJJ 50  
BBB 30  
FFF 50  
FFF 25  24-Aug-15
CCC 75  
JJJ 30  
FFF 50  
JJJ 36  24-Aug-15
FFF 50  24-Aug-15

I need the result as below. 我需要如下结果。

Name Qt
AAA 40
BBB 30
CCC 175
FFF 300
GGG 400
JJJ 80
NNN 50
SSS 50

Rows with date field(column D) having a value should be omitted from adding. 日期字段(D列)具有值的行应从添加中省略。

Name field can contain any name and future names can vary from current names. 名称字段可以包含任何名称,将来的名称可以与当前名称不同。

The Result can be in the same sheet or in the different sheet. 结果可以在同一张纸中,也可以在另一张纸中。

This may not meet your exact needs but it should get you the data you want in the first instance. 这可能无法满足您的确切需求,但应该可以在一开始就获得所需的数据。

  1. In Excel select the Insert tab and select Pivot Table . 在Excel中,选择“ 插入”选项卡,然后选择“ 数据透视表”
  2. Set the table range to be A1 to C60000 (or whatever the max number of rows is) 将表范围设置为A1到C60000(或任何最大行数)
  3. Select New Worksheet and click OK . 选择新建工作表 ,然后单击确定
  4. Add the Name and Qt fields to the report. 名称Qt字段添加到报告中。 It should automatically sum Qt. 它应该自动求和Qt。
  5. Add Date to the Filters . 日期添加到过滤器 This should add a bar above the pivot table that says something like: 这应该在数据透视表上方添加一个条,内容如下:
    Date (All)
  6. Click on (All) and select (blank) , and that should exclude the rows with dates specified. 单击(全部),然后选择(空白) ,这应排除具有指定日期的行。

use helper cells next to the date range =isblank(d2) this will return TRUE in E2 在日期范围= isblank(d2)旁边使用辅助单元格,这将在E2中返回TRUE

put AAA in G6, in H6 put the following formula =SUMIFS(C:C,E:E,"TRUE",B:B,G6) 在G6中放置AAA,在H6中放置以下公式= SUMIFS(C:C,E:E,“ TRUE”,B:B,G6)

if there is trash data in the blank cells like random spaces and whatnot use =isblank(trim(d2)) 如果空白单元格中有垃圾数据,例如随机空间,则不使用= isblank(trim(d2))

i loooove pivot tables but sometimes they just make file sizes too big if using a bunch of them in a single workbook, i also get tired of refreshing them. 我松动数据透视表,但如果在单个工作簿中使用一堆表,有时它们会使文件大小太大,我也厌倦了刷新它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 VBA代码基于Excel中另一列中的值对一列中的值求和 - VBA Code to sum values in one column based on the value in another column in excel 基于另一列Excel VBA中特定值的总计 - Sum totals based on specific value in another column excel VBA Excel - 基于另一列中的不同值的总和值 - Excel - sum values based on distinct value in another column 如何根据excel的另一列值对列求和 - how to sum of columns based on another column value of excel 根据 Excel 中的另一个值更新一列中的值 - Update value in one column based on another value in Excel 如何根据 Excel 中的一列和另一列中的第 n 个值的条件查找列中的值? - How to find value in column based on criteria from one column and nth value in another column in Excel? Excel根据另一列的值合并/合并一个列 - Excel Combining/Concatenating one column based on the value of another (Excel 2013 / Non-VBA)格式数据列基于其他单元格的值吗? - (Excel 2013/Non-VBA) Format Data column based on value of another cell? Excel,计算一列的总和,其中另一列中的相应行等于一个值 - Excel, Calculate Sum of one column where the corresponding row in another column equals a value 在Excel中,对每行中一列中的所有值求和,其中另一列是特定值 - In Excel, sum all values in one column in each row where another column is a specific value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM