Logical
All versions
◉ 29 views
=AND()
Use the AND function, one of the logical functions, to determine if all conditions in a test are TRUE.
Applies To:
Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016
=AND(logical1, [logical2], ...)
Hover argument names in the table for details.
Output typeLogical
Popularity50 / 100
VolatileNo
Dynamic ArrayNo
📥 Download sample .xlsx — Coming soon
▦ Try in Playground
Dedicated file for this function — safe & lightweight · sample data + live formulas
⬇ Download Sample Workbook
A dedicated .xlsx for =AND() with Persian sample data & live formulas — open in Excel and practice.
- Sheet “Sample” — data table + formula in place
- Sheet “Guide” — syntax, arguments & tips from this page
- Instant & secure (token + rate limit)
🧠 🧠 Quiz this function
%d questions — syntax, example & errors — test yourself!
◧ Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
logical1 |
Logical | Required | The first condition that you want to test that can evaluate to either TRUE or FALSE. |
logical2 |
Logical | Optional | Additional conditions that you want to test that can evaluate to either TRUE or FALSE, up to a maximum of 255 conditions. |
▣ Examples
Displays TRUE if A2 is greater than 1 AND less than 100, otherwise it displays FALSE.
=AND(A2>1,A2<100)
Displays the value in cell A2 if it's less than A3 AND less than 100, otherwise it displays the message "The value is out of range".
=IF(AND(A2<A3,A2<100),A2,"The value is out of range")
Displays the value in cell A3 if it is greater than 1 AND less than 100, otherwise it displays a message. You can substitute any message of your choice.
=IF(AND(A3>1,A3<100),A3,"The value is out of range")
Example 4
=IF(AND(B14>=$B$7,C14>=$B$5),B14*$B$8,0)
§ Remarks
- The arguments must evaluate to logical values, such as TRUE or FALSE, or the arguments must be arrays or references that contain logical values.
- If an array or reference argument contains text or empty cells, those values are ignored.
- If the specified range contains no logical values, the AND function returns the #VALUE! error.
✦ Tips
- The arguments must evaluate to logical values, such as TRUE or FALSE, or the arguments must be arrays or references that contain logical values.
- If an array or reference argument contains text or empty cells, those values are ignored.
⚠ Common Errors
#VALUE!
If the specified range contains no logical values, the AND function returns the #VALUE! error.
Fix: Write the condition as a comparison
💬 Comments & Q&A 0 approved
🔒 Your comment will be published after review.Share your thoughts — visible after admin approval
No comments yet — be the first!