Excel functions and formulas: AND

Function name: AND

Format: =AND(Condition1,Condition2,...)

When using the AND function, the result returns TRUE only if each condition is met, otherwise it returns FALSE.

example

There are 3 columns in the example, only when each column is 1, column D will output TRUE, as long as there is a 0, it will return FALSE
initial style

  1. The cursor is positioned on cell D2;
  2. Enter the formula: =AND(A2:C2=1)
  3. press ctrl+ shift+回车键
  4. Select D2 to D4, then press ctrl+ D
    and the table result will look like this:
    insert image description here

At this time, the result is correct. Most people have no problem here, but here we need to analyze the formula in depth. First, let’s look at the formula of D2: {=AND(A2:C2=1)}

If it is =AND(A2=1,B2=1,C2=1), the meaning is the same as written in the above format, if the value of cell A2 is 1, and B2 is also 1, and C2 is also 1, then the value of D2 is TRUE.
But now there are 3 problems:

  • What does A2:C2=1 mean?
  • What is the use of the outermost {}
  • why press ctrl+ shift+回车键
  • ctrl+ Dwhat does it do
A2:C2=1

Represents continuous cells A2 to C2, including three cells: A2, B2, and C2, but this needs to be used with {}.

The outermost {}

The formula with {} on the outermost layer is an array formula, here the formula is: A2=1 AND B2=1 AND C2=1

why press ctrl+ shift+回车键

Pressing this shortcut key in excel will automatically add {} outside the formula, be careful not to add it manually

ctrl+ Dwhat does it do

When there is a formula in D2, when cells D2 to D4 are selected, pressing ctrl+ Dwill apply the formula to the cells D3 and D4 below

Guess you like

Origin blog.csdn.net/wudechun/article/details/106523128
Recommended