# Syntax question on a simple And formula

#### Rugman67

##### New Member
[FONT=&quot]AND(logical1, [logical2], ...)

I have not been schooled in syntax if someone has a good beginner guide I would love to read it.

The question I have is on the [brackets] for the second logical2, why are there brackets there, what do they denote? When entering the logical2 data I am not required to enter [brackets] so why is it there?

I thought maybe brackets meant the second logical test is not required but when you are using an And, you need to have two logical test, perhaps the syntax should say And(logical1,logical2,[logical3]) if like I said they denote it may not be required for an AND formula to work.

Rugman67[/FONT]

### Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

#### gaz_chops

##### Well-known Member
As far as I am aware there is no need, just use

And(logical1,logical2,logical3)

#### AliGW

##### Banned
As Gaz has said, they are not needed. Example:

=IF(AND(A4=3,B4=2,C4=1),"Match","No Match")

#### Weazel

##### Well-known Member
i think the OP is referring to the help, which shows the 2nd logical test in brackets.

#### BarryL

##### Well-known Member
[] these denote an optional entry, so no the logical2 is not obligatory and a formula would work without it. Obvioulsy you wouldn't use AND without more than one logic generally but you can use AND with arrays that can be convenient with just one logic. For example if you had Apple in A1 and A2, Orange In B1 and B2. the below AND array would return TRUE

{=AND(A1:B1=A2:B2)}

(array so enter with ctrl+shift+enter)

#### Rugman67

##### New Member
BarryL that is what I thought they meant, that is to say optional but how can they be "optional" when it is an And Statement, and AND statement is two or more conditions, it seems like the syntax is incorrect and the [] should be on the 3rd condition, meaning the first two conditions are required and the 3rd is optional but perhaps I am reading too much into it.

#### AliGW

##### Banned
Consider Barry's example:

={=AND(A1:B1=A2:B2)}

How many logicals are there? Answer: one (A1:B1=A2:B2).

In the vast majority of uses there will be at least two, but because of the above, Excel can't make two logicals mandatory.

#### BarryL

##### Well-known Member
Consider Barry's example:

={=AND(A1:B1=A2:B2)}

How many logicals are there? Answer: one (A1:B1=A2:B2).

In the vast majority of uses there will be at least two, but because of the above, Excel can't make two logicals mandatory.

Exactly. Imagine if you had to compare A1:A500=B1:B500 in one cell and write 500 AND logics. It serves a purpose however limited.

Replies
1
Views
1K
Replies
3
Views
149
Replies
0
Views
510
Replies
5
Views
346
Replies
1
Views
153

1,191,196
Messages
5,985,227
Members
439,950
Latest member
Xearo96

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back