Syntax question on a simple And formula

Rugman67

New Member
Joined
Dec 12, 2016
Messages
9
[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.

thanks in Advance.
Rugman67[/FONT]
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
As far as I am aware there is no need, just use

And(logical1,logical2,logical3)
 
Upvote 0
As Gaz has said, they are not needed. Example:

=IF(AND(A4=3,B4=2,C4=1),"Match","No Match")
 
Upvote 0
i think the OP is referring to the help, which shows the 2nd logical test in brackets.
 
Upvote 0
[] 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)
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,568
Messages
6,120,278
Members
448,953
Latest member
Dutchie_1

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top