跳到主要内容

如何基于Excel中另一列中的条件求和值?

有时您想基于另一列中的条件求和,例如,在这里我只想总结“销售量”列,其中相应的“产品”列等于“ A”,如下所示,您该怎么做它? 当然,您可以将它们一一求和,但是在这里,我介绍了一些简单的方法供您对Excel中的值求和。

在Excel中具有公式的基于另一列中条件的求和值

基于Excel中数据透视表的另一列中的条件的值求和

使用Kutools for Excel在另一列中基于条件求和的值

按条件列将数据拆分到新表中,然后求和


在Excel中具有公式的基于另一列中条件的求和值

在Excel中,您可以使用公式根据相邻列中的某些条件快速求和值。

1.复制将基于其进行汇总的列,然后粘贴到另一列中。 在我们的例子中,我们复制了Fruit列并粘贴到E列中。请参见左侧的屏幕截图。

2.保持选中粘贴列,单击 时间 > 删除重复。 然后在弹出的“删除重复项”对话框中,仅检查粘贴的列,然后单击 OK 按钮。

3.现在,仅唯一值保留在粘贴列中。 除了粘贴的列,选择一个空白单元格,键入公式 =SUMIF($A$2:$A$24, D2, $B$2:$B$24) 放入其中,然后根据需要将其“自动填充句柄”向下拖动。

然后我们根据指定的列进行求和。 看截图:

备注:在上面的公式中,A2:A24是您要基于其值求和的列,D2是粘贴的列中的一个值,而B2:B24是要求和的列。

根据Excel中另一列中的条件轻松求和/计数/平均值

Kutools for Excel的 高级组合行 实用程序可以帮助Excel用户根据另一列中的条件轻松地对一列中的值进行批量求和,计数,平均值,最大值,最小值。


在另一列02中按条件计算的文档总和

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

基于Excel中数据透视表的另一列中的条件的值求和

除了使用公式,您还可以通过插入数据透视表在另一列中基于条件求和。

1.选择所需的范围,然后单击 插页 > 数据透视表 or 插页 > 数据透视表 > 数据透视表 打开“创建数据透视表”对话框。

2.在“创建数据透视表”对话框中,指定将新数据透视表放置在的目标范围,然后单击 OK 按钮。

3.然后在 数据透视表字段 窗格中,将条件列名称拖到 部分,将您要汇总的列拖到 价值观 部分。 看截图:

然后,您可以看到上面的数据透视表,它已基于条件列中的每个项目对“金额”列进行了汇总。 参见上面的截图:


将值求和并根据另一列中的条件与Kutools for Excel合并

有时,您可能需要根据另一列中的条件对值求和,然后将原始数据直接替换为求和值。 您可以将Kutools用于Excel的 高级组合行 效用。

Kutools for Excel - 包含 300 多个 Excel 基本工具。 享受全功能 30 天免费试用,无需信用卡! 现在下载!

1.在另一列中选择要根据条件求和的值范围,然后单击 库工具 > 内容 > 高级组合行.

请注意,该范围应同时包含您要基于其汇总的列和您要对其进行汇总的列。

2.在打开的“基于列合并行”对话框中,您需要:
(1)选择您要基于其进行汇总的列名称,然后单击 首要的关键 按钮;
(2)选择要累加的列名,然后单击 计算 > 总和.
(3)点击 Ok 按钮。

现在,您将看到根据另一列中的条件对指定列中的值进行求和。 参见上面的截图:

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!


演示:使用Kutools for Excel在另一列中基于条件求和


Kutools for Excel:超过 300 个方便的工具触手可及! 立即开始 30 天免费试用,没有任何功能限制。 立即下载!

根据Excel列中的条件轻松将范围分为多个工作表

Kutools for Excel的 拆分数据 实用程序可以帮助Excel用户根据原始范围的一列中的条件轻松地将范围分为多个工作表。


广告分割数据0

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

相关文章:

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (16)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
i need one excel sheet column total value automatically to another excel sheet to generate repot.
This comment was minimized by the moderator on the site
You are amazing!!

Thanks for this!
Rated 5 out of 5
This comment was minimized by the moderator on the site
In the latest Excel, you need to use ; instead of , as the separator for the arguments, so '=SUMIF($A$2:A15; D2; $B$2:$B$15)' is the correct syntax in the first example.  
This comment was minimized by the moderator on the site
Hi,I want to sum a range of numbers in a column, which will start with a particular text in another column and till a particular text in same text column. Please help
This comment was minimized by the moderator on the site
I have two Columns A & B. A is a numeric value as well as B. I want to: If A equals (say 4) or more, then count B. I want the sum count of all B's added.
ex:
A. B. 1 54 76 103 9
Sum: 17
Any help? I imagine it is some sort of countif function - has been a while for me.
Thanks!
This comment was minimized by the moderator on the site
Hi,=SUMIF(A1:A4,">="&4,B1:B4)
This comment was minimized by the moderator on the site
wow, thank you so much, i learnt a new thing from ua article, it helped me a lot & saved lot of my time
This comment was minimized by the moderator on the site
if two coulumn have same fruit then add them like this
apple orange grapes apple
2 4 5 7
5 4 3 23
21 3 34 22

then i would like to add total no. of apples
can this be done by any formula or some tricks
This comment was minimized by the moderator on the site
Hi Surat,
What about adding the total number manually?
Holding the SHIFT key, select both Apple columns simultaneously, and then you will get the total number in the status bar.
This comment was minimized by the moderator on the site
Hi. I have two types of Payments in cell G5:G51 ("Security" and "Rental"). The amount is in cell H5:H51. I wan to sum up all the security Payments in Cell K5 and All Rental Payments in Cell K6. How can I do it.
This comment was minimized by the moderator on the site
thanks for the excellent - quick & easy instructions for creating totals based on "distinct" values
This comment was minimized by the moderator on the site
I want sum FABRICS 2014> 16.90 mtr N-15FLAT011W/O STONES(BLUE) 16.90 mtr SP12044-GGT-TL#1255 FNC 2014 > N-MT#28-#4(SILVER) 11.50 mtr N-MT#5-#7(SKY BLUE) 28.90 mtr FPR 2014> M-FML-A478(RED) 6.79 mtr N-PR-#8961-(PINK) 18.30 mtr
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations