提示:其它语言是由 Google 机器翻译的。 你可以访问 English 版本。
登录
x
or
x
x
马上登记
x

or

如何根据Excel中的文本条件来求和值?

在Excel中,你有没有尝试基于另一列文本标准来求和值? 例如,我在工作表中有一系列数据,如下面的截图所示,现在,我想将列B中与列A中符合特定标准的文本值相对应的所有数字相加,例如,如果A列中的单元格包含KTE。

DOC-总和为基础,对文本,1

如果包含某些文本,则基于另一列的值进行求和

如果以某些文本开始,则基于另一列求和这些值

如果以特定文本结尾,则基于另一列的值进行求和

如果只有某些文本,则根据另一列求和这些值


高级合并行(合并重复行和总和/平均对应值):
  • 1。 指定您想要组合其他列的键列;
  • 2。 为您的组合数据选择一个计算。
  • DOC-总和柱酮标准-7

    Kutools for Excel:比200方便的Excel加载项,可以在60天免费试用。 下载并免费试用现在!


    箭头蓝色右泡 如果包含某些文本,则基于另一列的值进行求和


    让我们以上面的数据为例,将A列中包含文本“KTE”的所有值一起添加,下面的公式可以帮助您:

    请输入此公式 = SUMIF(A2:A6, “* KTE *”,B2:B6) 放入空白单元格中,然后按 输入 键,然后列A中的相应单元格包含文本“KTE”的所有数字将加起来。 查看屏幕截图:

    DOC-总和为基础,对文本,2
    -1
    DOC-总和为基础,对文本,3

    小技巧:在上面的公式中, A2:A6 是您添加值所基于的数据范围, * KTE * 代表您需要的标准,B2:B6是您想要求和的范围。


    箭头蓝色右泡 如果以某些文本开始,则基于另一列求和这些值

    如果您只是想将列B中的单元格值与列A中的相应单元格(文本以“KTE”开头)相加,则可以应用此公式: = SUMIF(A2:A6 “KTE *”,B2:B6),看截图:

    DOC-总和为基础,对文本,4
    -1
    DOC-总和为基础,对文本,5

    小技巧:在上面的公式中, A2:A6 是您添加值所基于的数据范围, KTE * 代表您需要的标准,而B2:B6是您想要求和的范围。


    箭头蓝色右泡 如果以特定文本结尾,则基于另一列的值进行求和

    要将B列中所有值填入列A中文本以“KTE”结尾的相应单元格,此公式可以帮助您: = SUMIF(A2:A6, “* KTE”,B2:B6)A2:A6 是您添加值所基于的数据范围, KTE * 代表您需要的标准,并且 B2:B6 是你想要总结的范围)看截图:

    DOC-总和为基础,对文本,6
    -1
    DOC-总和为基础,对文本,7

    箭头蓝色右泡 如果只有某些文本,则根据另一列求和这些值

    如果您只是想将B列中的相应单元格内容的值与列A的“KTE”相加,请使用以下公式: = SUMIF(A2:A6, “KTE”,B2:B6)A2:A6 是您添加值所基于的数据范围, KTE 代表您需要的标准,并且 B2:B6 是你想要求和的范围),然后只有列A中的文本是“KTE”,B列中的相对数将加起来,参见屏幕截图:

    DOC-总和为基础,对文本,8
    -1
    DOC-总和为基础,对文本,9

    相关文章:

    如何在Excel中总结每n行?

    如何在Excel中对文本和数字的单元格进行求和?


    Kutools for Excel解决了您的大多数问题,并使您的生产率提高了80%

    • 重用: 快速插入 复杂的公式,图表 以及你以前用过的任何东西; 加密单元格 密码; 创建邮件列表 并发送电子邮件...
    • 超级方程式酒吧 (轻松编辑多行文字和公式); 阅读布局 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
    • 合并单元格/行/列 不丢失数据; 分裂细胞含量; 组合重复的行/列...防止重复的细胞; 比较范围...
    • 选择复制或唯一 行; 选择空行 (所有细胞都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择......
    • 精确复制 多个单元格而不更改公式参考; 自动创建参考 多张表; 插入项目符号,复选框等等......
    • 提取文本,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
    • 超级过滤器 (将过滤方案保存并应用到其他工作表); 高级排序 按月/周/日,频率等; 特殊过滤器 用粗体,斜体......
    • 结合工作簿和工作表; 根据键列合并表; 将数据拆分为多个表格; 批量转换xls,xlsx和PDF...
    • 超过300强大的功能。 支持Office / Excel 2007-2019和365。 支持所有语言。 在您的企业或组织中轻松部署。 全功能30天免费试用。
    kte tab 201905

    Office选项卡为Office提供选项卡式界面,使您的工作更轻松

    • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,Publisher,Access,Visio和Project。
    • 在同一窗口的新选项卡中打开并创建多个文档,而不是在新窗口中。
    • 通过50%提高您的工作效率,每天为您减少数百次鼠标点击!
    官方底部
    Say something here...
    symbols left.
    You are guest ( Sign Up? )
    or post as a guest, but your post won't be published automatically.
    Loading comment... The comment will be refreshed after 00:00.
    • To post as a guest, your comment is unpublished.
      Chanikya Nadh Desu · 3 months ago
      I create a dynamic string which contains the cells to sum and pass this string to sum function and it gives me #value error. Any solution to this.
      • To post as a guest, your comment is unpublished.
        skyyang · 3 months ago
        Hi, Desu,
        Could you give your problem more detailed, thank you!
    • To post as a guest, your comment is unpublished.
      Paige · 4 months ago
      By the way, I’m using the =SUMIF(A2:A6,"*KTE*",B2:B6) formula, and I want to do more than just the B column (up to column AM).
      • To post as a guest, your comment is unpublished.
        skyyang · 3 months ago
        Hello, Paige,
        For solving your problem, may be there is no simple formula, you should join the SUMIF function together to get the result as you need, for example, you can use the below formula: (you can add other columns data with combining the sumif function)

        =SUM(SUMIF(A2:A6,"*kte*",B2:B6), SUMIF(A2:A6,"*kte*",C2:C6), SUMIF(A2:A6,"*kte*",D2:D6))

        Please try it, hope it can help you!
    • To post as a guest, your comment is unpublished.
      Paige · 4 months ago
      This works but what if I want to use the last part of the formula to cover multiple columns instead of just one?
    • To post as a guest, your comment is unpublished.
      Jordan · 1 years ago
      how do I use a sumif in the following. If a certain cell contains the values of an substring of data, than sum a nearby column. for example, Cell A1 has (Dan,Tom,Bill,Smith). Then a separate table has Dan - 2, Bill - 3, John - 4. Assuming that is a 2x3 table. I want to create a formula that can sum the Dan and Bill numbers (2+3) because those texts could be found in cell A1. So the total would return 5.
    • To post as a guest, your comment is unpublished.
      Lisa Matusiak · 1 years ago
      How do you us sumif formula to with two criteria? For instance, If Column A = X and Column C = C then Sum Column G.
    • To post as a guest, your comment is unpublished.
      Lucky Arora · 1 years ago
      Hi, any one here is having an idea of how to calculate value containing in a cell (Or with text?
      For Example: in Cell A= MR134 , B= MR143, C = MR187 and result will be like sum of 134+143+187 =?
      • To post as a guest, your comment is unpublished.
        Zahirul · 5 months ago
        I am looking for this solution too.
        • To post as a guest, your comment is unpublished.
          skyyang · 5 months ago
          Hello, guys,
          May be the below array formula can help you: (after typing the formula, please press Ctrl+Shift+Enter together)
          =SUM(IF(ISNUMBER(SEARCH("MR",B1:B4)),SUBSTITUTE(B1:B4,"MR",""))+0)
          Please change the cell references to your need.
    • To post as a guest, your comment is unpublished.
      Hector · 1 years ago
      This is super clear and understandable, thank you so much!!!
    • To post as a guest, your comment is unpublished.
      Tom · 1 years ago
      This was super helpful :)
    • To post as a guest, your comment is unpublished.
      JOHN · 2 years ago
      hOW WOULD THIS WORK IF YOU WANTED TO SUM CELLS WITH TEXT THAT CONTAIN KTE & KTO
      • To post as a guest, your comment is unpublished.
        Shay · 1 years ago
        I'm not sure if you mean cells with two different things written in them or cells that say one thing AND cells that say another but for the second case, I just tried this and I wrote it as two separates pieces added together so it could look something like this:
        =(SUMIF(E:E,"*KTE*",D:D) + SUMIF(E:E,"*KTO*",D:D))
    • To post as a guest, your comment is unpublished.
      manoj singh · 3 years ago
      i am insert the sumif formula with correct ranges but it is not showing the sum of numeric values. only showing result 0. Actually some of cells contains text ( i.e.- with ajay, with sonu etc.)
      kindly help for the issue.
    • To post as a guest, your comment is unpublished.
      bassem · 3 years ago
      i want to make sumifs formula from range . but the sum range is formatted text