> For the complete documentation index, see [llms.txt](https://ksaar.gitbook.io/ksaar-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ksaar.gitbook.io/ksaar-documentation/les-elements/les-calculs/calculs-conditionnels.md).

# Calculs conditionnels

Les calculs conditionnels permettent de conditionner vos calculs à l'aide de la fonction `SI` ou `IF`.&#x20;

La fonction `SI(CONDITION,VALEUR_SI_VRAI,VALEUR_SI_FAUX)` renvoie VALEUR\_SI\_VRAI si la CONDITION est vérifiée, sinon elle renvoie VALEUR\_SI\_FAUX.

La condition peut prendre la forme :

* A>B&#x20;
* A\<B
* A==B

A et B sont des nombres ou renvoient des nombres

* ET(Condition1, Condition2) => Vrai si les deux conditions sont vérifiées&#x20;
* OU(Condition1, Condition2) => Vrai si au moins une des conditions est vérifiée

{% hint style="info" %}
Les VALEUR\_SI\_VRAI et VALEUR\_SI\_FAUX doivent renvoyer des nombres.&#x20;
{% endhint %}

#### Exemple d'utilisation:

Vous souhaitez connaître le dépassement d'un budget. Pour cela, définissez deux champs nombre **{Budget}** et **{Dépense Réelle}**.&#x20;

Effectuez un calcul qui renvoie le dépassement si la dépense réelle est supérieure au budget, 0 sinon.

<figure><img src="/files/UW7NJ8UBLE1zHBW8GLj1" alt="" width="563"><figcaption><p>Paramétrage du calcul de dépassement</p></figcaption></figure>

Le résultat du calcul peut être affiché quand l'utilisateur rentre des valeurs pour le budget et la dépense:

<figure><img src="/files/jZIrZBoMrU65JAvIPFUA" alt="" width="563"><figcaption><p>Résultat pour l'utilisateur</p></figcaption></figure>


---

# 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://ksaar.gitbook.io/ksaar-documentation/les-elements/les-calculs/calculs-conditionnels.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.
