跳到主要内容

如何在Excel中求和相邻单元格是否相等,为空白或包含文本?

使用Microsoft Excel时,您可能需要对相邻单元格等于某个范围内的条件的值求和,或者对相邻单元格为空白或包含文本的值求和。 在本教程中,我们将为您提供解决这些问题的公式。

Sumif相邻单元格等于Excel中的条件
Sumif相邻单元格在Excel中为空
在Excel中将包含文本的相邻单元格求和


Sumif相邻单元格等于Excel中的条件

如下面的屏幕快照所示,您需要对牛肉的所有价格求和。 请执行以下操作。

1.指定用于显示结果的单元格。

2.复制并粘贴公式 =SUM(IF(A4:E10=A13, B4:F10, 0))配方栏,然后按 按Ctrl + 转移 同时按Enter键可获得结果。

备注:在公式中,A4:E10是包含所需特定条件的数据范围,A13是您要基于其对像元求和的条件,而B4:F10是具有要求和的值的范围。 。 请根据您自己的数据更改范围。


轻松合并一列中的重复项,并基于Excel中的重复项将另一列中的值求和

Kutools for Excel's 高级组合行 实用程序可帮助您轻松地合并列中的重复行,并基于Excel中的重复项来计算或合并另一列中的值
立即下载并试用! (30 天免费试用)


Sumif相邻单元格在Excel中为空

例如,您有一个范围A2:B7,只需要对相邻单元格为空的值求和。 请参见下面的屏幕截图。 您需要执行以下操作。

1.选择一个空白单元格以显示结果。 复制并粘贴公式 = SUM(IF(ISBLANK(B2:B7),A2:A7,0)) (B2:B7是包含空白单元格的数据范围,而A2:A7是要求和的数据)进入公式栏,然后按 按Ctrl + 转移 + 输入 同时获得结果。

然后,您可以看到所有相邻单元格为空白的值相加并显示在指定的单元格中。

在Excel中将包含文本的相邻单元格求和

上面的方法可以帮助您求和一定范围内相邻单元格为空白的值。 在本节中,您将学习如何在Excel中相邻单元格包含文本的地方对值求和。

只需使用与上述方法相同的示例即可。

1.选择一个空白单元格,复制并粘贴公式 = SUMIF(B2:B7,“ <>”&“”,A2:A7) (B2:B7是包含文本单元格的数据范围,而A2:A7是您要求和的数据)进入公式栏,然后按 按Ctrl + 转移 + 输入 键。

您将看到在相邻单元格中包含文本的所有值相加并显示在所选单元格中。

最佳办公生产力工具

🤖 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 (14)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Sumif Adjacent Cell Equals A Criterion In Excel formula is not working for me, it is adding everything instead of just the cells with data we want.
This comment was minimized by the moderator on the site
Hi Cole,
Which Excel version are you using? Would you mind providing a screenshot of your data?
This comment was minimized by the moderator on the site
Hello I am trying to set up a pricing list. I have used a dropdown list for the selected products. How do I make excel input a price based on the choice of the text in the dropdown list.
This comment was minimized by the moderator on the site
Hi erin,
Methods in this article can help you. Please have a try: https://www.extendoffice.com/documents/excel/2400-excel-drop-down-list-auto-populate.html
This comment was minimized by the moderator on the site
I am trying to get a return value of "yes" if A1:A7 contains any text. What formulas can I use?
This comment was minimized by the moderator on the site
Dear Wyman Thomas,
Supposing you need to return value of "Yes" if cell A1 contains "Apple", this formula can help you =IF(ISNUMBER(SEARCH("Apple",A1)), "Yes", "No").
This comment was minimized by the moderator on the site
Pretty sure

=SUMIF(B2:B7,"<>"&"",A2:B7) should be


=SUMIF(B2:B7,"<>"&"",A2:A7)
This comment was minimized by the moderator on the site
Few People Notice that, We take it A2:A7
This comment was minimized by the moderator on the site
Hi,
Thank you for your reminding.
This comment was minimized by the moderator on the site
Dear all. I would like to use the SUMIF function in the following way: -Sum range is 1:1 -Criteria Range is 2:2 -Criteria is "jorge" However, I would like the function o work a little bit different. If "jorge" is found on B2, I would like A1 to be sum instead of A2. I tried =SUMIF(1:1,OFFSET(2:2,,1),"jorge") but excel does not accept such criteria range argument. How to get it working?
This comment was minimized by the moderator on the site
I am looking to create a budget spreadsheet. My goal is to plug in my daily expenses, with the category in one cell and the amount in the cell beneath. As far as my spending goes, I have no problem calculating. However, I am struggling with a formula to create a running tally of each category. Can you help?
This comment was minimized by the moderator on the site
Mike I am working on the same problem I created a drop down list for column D and my costs are in column C. Simply change the name (Contracts) of the formula to your category name. =SUMIF(D2:D31,""Contracts"",C2:C31)
This comment was minimized by the moderator on the site
hi, hope you could help me on this i want to create a formula where-in the codes under the subnet, be reflected on the net. see below place(net) 1 place1 2 place2 3 place3 4 place4 5 place5 where place net should have a code 1+2+3+4+5, i know how to concatenate and use "&" but i need to have a formula where i could drag it down since its not the only net in my specs, hoping for your answer? bog thanks regards, jayson
This comment was minimized by the moderator on the site
I would like to get the return value "yes" if the cells in A1:A7 contain data. What formula can I use?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations