Note: The other languages of the website are Google-translated. Back to English
登陆  \/ 
x
or
x
注册  \/ 
x

or

如何在Excel中比较多个单元格是否相等?

众所周知,要比较两个单元格是否相等,可以使用公式A1 = B1。 但是,如果要检查多个单元格是否具有相同的值,则此公式将不起作用。 今天,我将讨论一些公式以比较Excel中多个单元格是否相等。

比较多个单元格是否与公式相等


箭头蓝色右气泡 比较多个单元格是否与公式相等

假设我具有以下数据范围,现在我需要知道A1:D1中的值是否相等,要解决此任务,以下公式将为您提供帮助。

doc-if-equal-cells-1

1。 在数据旁边的空白单元格中,请输入以下公式: = AND(EXACT(A1:D1,A1))A1:D1 指示您要比较的单元格,以及 A1 是您数据范围内的第一个值),请参见屏幕截图:

doc-if-equal-cells-2

2。 然后按 Ctrl + Shift + Enter 键在一起以获得结果,如果单元格值相等,它将显示 TRUE,否则将显示 FALSE,请参见屏幕截图:

doc-if-equal-cells-3

3。 并选择单元格,然后将填充手柄拖到您要应用此公式的范围,您将获得如下结果:

doc-if-equal-cells-4

备注:

1.上面的公式区分大小写。

2.如果需要比较不区分大小写的值,则可以应用以下公式: = COUNTIF(A1:D1,A1)= 4A1:D1 表示您要比较的单元格, A1 是您数据范围内的第一个值,数字 4 是指您要检查的单元格的数量),然后按 输入 密钥,您将得到以下结果:

doc-if-equal-cells-5


比较两个范围,找出像元是否相等

Kutools for Excel比较单元格 实用程序,您可以快速找到两个单元格之间的相同或不同的值。 点击下载Kutools for Excel!

Kutools for Excel:具有300多个方便的Excel加载项,可以在30天内免费试用,没有任何限制。 立即下载并免费试用!


相关文章:

如何在Excel中检查数字是否为整数?


最佳办公效率工具

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

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

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

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
officetab底部
Say something here...
symbols left.
You are guest
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.
    shabazali · 2 months ago
    hello sir, 
    i have 6 columns of 2 tables in different sheets, but i want to match 2nd tables data with 1st tables data.
  • To post as a guest, your comment is unpublished.
    Joanne · 4 months ago
    I have two cols with numbers and want to find the matches but the same/ different number are not in the same row. How do i
    • To post as a guest, your comment is unpublished.
      skyyang · 4 months ago
      Hello, Joanne,
      Can you give more details of your problem, or you can insert an image of your problem here?
      Thank you!
  • To post as a guest, your comment is unpublished.
    Prabakar · 4 months ago
    I have a scenario like this I have same values in col A, Col B and Col C ( AA,AA,AA) and I want to return the Same value AA if all 3 in SYNC in col D.
    Can anyone assist in this ?
    • To post as a guest, your comment is unpublished.
      skyyang · 4 months ago
      Hello, Prabakar,
      To solve your problem, please apply the below array formula:
      =IF(AND(EXACT(A2:C2,A2)),A2,"")
      After entering this formula, please remember to press Ctrl + Shift + Enter keys together to get the correct result.
      Please try it.
  • To post as a guest, your comment is unpublished.
    MARTIN · 1 years ago
    I HAVE 3 CELLS THAT CAN HAVE VALUE OF EITHER "W"OR"L" IE. W/L/W OR L/W/L OR W/L/L

    MEANING WIN OR LOSS

    HOW DO I COUNT 2 WINS OR 2 LOSSES? TO PUT ANSWER IN SINGLE CELL!
    • To post as a guest, your comment is unpublished.
      Robert K · 4 months ago
      Lets asume you have results in Columns A,B and C) starting in second row, For example you can add a helper Colum (all wins/loses) and add =if(Or(And(a2="W",b2="w",C2="W"),(a2="L",b2="L",C2="L"),0,1)
      And then just perform a sum at the end - the above will assign a 0 value to 3 wins or 3 losses, and a 1 value to other results
  • To post as a guest, your comment is unpublished.
    Suresh badhani · 2 years ago
    sO GRAET HELPFUL
  • To post as a guest, your comment is unpublished.
    AG · 2 years ago
    =COUNTIF(A1:D1,A1)=4 ---> mind = blown
  • To post as a guest, your comment is unpublished.
    M.Irfan · 3 years ago
    how can i find the matching numbers in a column
  • To post as a guest, your comment is unpublished.
    ar · 3 years ago
    hi, i want to display the value / text of a table if a particular value is below 100. is there any option
  • To post as a guest, your comment is unpublished.
    Dal · 3 years ago
    Hi
    I need to highlight multiple numbers that appear three times or more in one column.
    Can anyone assist?
    Thanks
    • To post as a guest, your comment is unpublished.
      skyyang · 3 years ago
      Hello, Dal,
      To highlight the cell values that appear three times or more, the Conditional Formatting can help you. Please enter this formula into the Conditional Formatting: =COUNTIF($F$2:$F$500,F2)>2 (Note: Change the cell references to your need),and then choose one color for highlighting the cells.
  • To post as a guest, your comment is unpublished.
    Bob Olanski · 3 years ago
    The "And(Exact...." works great if you have a set range. In my case, It is multiple cells within a range of columns.

    Basically need the comparison to evaluate A7, B7, M7, AD7, AE7, AX7, BC7, and BQ7, and return "TRUE" if they are identical text.
    • To post as a guest, your comment is unpublished.
      Michael Hughart · 2 years ago
      Did you ever get an answer to this question?
      • To post as a guest, your comment is unpublished.
        Morné Combrink · 7 months ago
        =AND(EXACT(A1=D1),EXACT(A1=C1),EXACT(A1=B1),EXACT(B1=D1),EXACT(B1=C1),EXACT(C1=D1)) - Here all 4 columns are being evaluated and if all 4 are an exact match you will return "TRUE".
        The "EXACT(A1=D1)" can be used indefinitely, but I would then rather turn to a MATCH function for large checks.
        • To post as a guest, your comment is unpublished.
          Penny · 5 months ago
          You mean this:-

          =AND(EXACT(B17,D17),EXACT(B17,F17),EXACT(B17,H17), EXACT(D17,F17), EXACT(D17,H17), EXACT(F17,H17) )
  • To post as a guest, your comment is unpublished.
    sonia · 3 years ago
    i want to know part number from in one column is duplicated in any other cells of adjacent column
  • To post as a guest, your comment is unpublished.
    Paul · 3 years ago
    I have Cells A1=35, A2-45, A3=50, A4=75, A5=80, B1=40, B2=19, B3=55, B4=31, B5=22. In this, A1 IS 35 AND B1 IS 40. What I want to find out is find out whether anywhere else in the range the this combination is appear or repeated and how many times it is repeated i need to know. Can anyone help me out in this. If there is no formula, a vba would be helpful, thanks in advance.
    • To post as a guest, your comment is unpublished.
      skyyang · 3 years ago
      Hi, Paul,
      Can you give your problem more clearly and you can upload an attachment screenshot here.
      Thank you!
  • To post as a guest, your comment is unpublished.
    Jim T · 4 years ago
    Interesting, this fails for me in 2016 version
    • To post as a guest, your comment is unpublished.
      skyyang · 4 years ago
      Hello, Jim,
      The above formulas work well in Excel 2016, when you apply the first formula, please remeber to press Shift + Ctrl + Enter keys together to get the correct result.
      Please try again, thak you !
  • To post as a guest, your comment is unpublished.
    jignesh · 4 years ago
    i have six column a b c d e f, in column e i want to put higher value among a & c, and in column f it is dependent on e, like if e is a than b, if e is c than d. how could i solve this???
  • To post as a guest, your comment is unpublished.
    Holly · 4 years ago
    This worked great for me I did =And(exact(A2:C2,D2:F2)) to validate that cells A2-C2 exactly matched D2-F2.

    Thanks so much!
  • To post as a guest, your comment is unpublished.
    Shan · 4 years ago
    I wanted to compare the alphabets with 4 columns for every 4 rows. For example,
    A = [aabc;dbba;a] B = [aabc;baba;c] C = [aabc;dbba;b] D = [bcac;bcbc;a]

    If we look at the table above shows first four rows, "aabc" repeated in 3 columns. So, out of 4, 3 gets correct matching.it is 3/4. for the second cycle, we can see "dbba" repeated so it 2/4.This is for 4 rows vs 4 rows, now the same matching method for taking one line down, two line down and three line down comparing with other string. Means, the rows will be constant and just the alphabets changing. The formula can be in the new column say E and results will be there. Any idea?
  • To post as a guest, your comment is unpublished.
    Shan · 4 years ago
    How about comparing multiple rows with certain columns?
    I wanted to compare the alphabets with 4 columns for every 4 rows.For Example,

    A = [aabc;dbba;a] B = [aabc;baba;c] C = [aabc;dbba;b] D = [bcac;bcbc;a]

    If we look at the table above shows first four rows, "aabc" repeated in 3 columns. So, out of 4, 3 gets correct matching.it is 3/4. for the second cycle, we can see "dbba" repeated so it 2/4.This is for 4 rows vs 4 rows, now the same matching method for taking one line down, two line down and three line down comparing with other string. Means, the rows will be constant and just the alphabets changing. The formula can be written in a new cell may be the next column E. Any Idea?
  • To post as a guest, your comment is unpublished.
    Frances H · 4 years ago
    Useful formula - works great thanks. I'm curious why do you have to use Ctrl + Shift + Enter ?
  • To post as a guest, your comment is unpublished.
    Archana Maru · 4 years ago
    Hi there!! I am very new to this excel validation and hence do not know much. I am trying to write a function in which if the values in A1 to A10 is True then the result in A11 should show Accepted and if they are not same then the result should prompt Rejected. Can you please help me write a forumula for the same.
    Thanks
  • To post as a guest, your comment is unpublished.
    Mimi · 4 years ago
    The cells that i want to compare value are not next to each other. So when i separate them in the formula with a "," it doesn't work.
  • To post as a guest, your comment is unpublished.
    EricMartinson · 4 years ago
    This is a great tip and did exactly what I needed. Very helpful! Thanks!
  • To post as a guest, your comment is unpublished.
    Sergey · 4 years ago
    This doesn't work for me, the result is returned as #VALUE!
    • To post as a guest, your comment is unpublished.
      Damo · 4 years ago
      You are not doing the "Ctrl + Shift + Enter keys together to get the result" part... I had the same issue, then read further in the article
  • To post as a guest, your comment is unpublished.
    imran · 5 years ago
    What about the empty cells?
    I have data on multiple columns and the column count is not same
    data is spread across columns upto 17
    some have data up to 4 columns
    • To post as a guest, your comment is unpublished.
      Mayank · 3 months ago
      Hello Sir,
      How can i compare a single cell with the whole row
      • To post as a guest, your comment is unpublished.
        Justin · 3 months ago
        I am trying to find that our too, I hope there is a solution