> For the complete documentation index, see [llms.txt](https://docs.valq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valq.com/model/formula-functions/logical-functions/and.md).

# AND

An AND function returns TRUE only if all the conditions are TRUE and returns FALSE if one or more conditions are FALSE.

### Syntax

AND(logical\_test1, ...logical\_test2?)

### Arguments

<table><thead><tr><th width="170">Arguments</th><th width="150">Data type</th><th>Description</th></tr></thead><tbody><tr><td>logical_test1</td><td>Number,text</td><td>The first condition to be evaluated. This is a required argument.</td></tr><tr><td>logical_test2?</td><td>Number,text</td><td>The additional conditions to be evaluated. These are optional arguments.</td></tr></tbody></table>

### Return Value

Either True or False values that are given in the arguments.

### Remarks

AND function accepts multiple conditions.

### Example

Consider the below scenario in which, if the number of licenses are greater than 500 **and** usage period is lesser than 24 months, the price should be $20 else $25.

<table data-full-width="true"><thead><tr><th width="178">Particulars</th><th width="122" align="center">Jan</th><th width="107" align="center">Feb</th><th width="112" align="center">Mar</th><th width="124" align="center">Apr</th><th width="140" align="center">May</th><th align="center">Jun</th></tr></thead><tbody><tr><td><mark style="color:purple;">No of Licenses</mark></td><td align="center">498</td><td align="center">497</td><td align="center">502</td><td align="center">505</td><td align="center">502</td><td align="center">498</td></tr><tr><td><mark style="color:orange;">Duration</mark></td><td align="center">25</td><td align="center">21</td><td align="center">22</td><td align="center">26</td><td align="center">23</td><td align="center">25</td></tr></tbody></table>

To achieve this, the following formula should be written in the \[Price] node:

<mark style="color:blue;">**`IF`**</mark>**`(`**<mark style="color:blue;">**`AND`**</mark>**`(`**<mark style="color:purple;">**`[No of Licenses]`**</mark>**`>500,`**<mark style="color:orange;">**`[Duration]`**</mark>**`<24),20,25)`**

### Result

<table><thead><tr><th width="129">Particulars</th><th align="center">Jan</th><th align="center">Feb</th><th align="center">Mar</th><th align="center">Apr</th><th align="center">May</th><th align="center">Jun</th></tr></thead><tbody><tr><td>Price</td><td align="center">25</td><td align="center">25</td><td align="center">20</td><td align="center">25</td><td align="center">20</td><td align="center">25</td></tr></tbody></table>

As you can see, the price is 20 when both the conditions (No of licenses>500 and Duration<24) are true (in Mar and May). Even if one of the conditions is false, as seen for the other periods, the price is 25.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.valq.com/model/formula-functions/logical-functions/and.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
