Help

Re: Formula IF+AND with multiples conditions

Solved
Jump to Solution
1843 6
cancel
Showing results for 
Search instead for 
Did you mean: 
Mathilde_Cotria
4 - Data Explorer
4 - Data Explorer

Hello :slightly_smiling_face:
I am a beginner in the creation of Airtable formulas.
Is it possible to create a formula IF(AND(value1,value2,value3) with at least 3 conditions ? I only succeeded it with 2 conditions.
If it’s not possible, do you know how i can make it with others formulas ?

Tx u very much for your help/time

1 Solution

Accepted Solutions
Chris-T
6 - Interface Innovator
6 - Interface Innovator

Hi Mathilde. If there are only two values for {CONTRAT}, CDI & CDD, then you could use the formula…

(IF{CONTRAT}=“CDI”, IF({ENTITE}!=‘BIOULTIME’,SWITCH({STATUT},‘Cadre’,3,‘Agent de maîtrise’,2,‘Employé’,1),SWITCH({STATUT},‘Cadre’,4,‘Agent de maîtrise’,3,‘Employé’,2)))

This will leave the field empty if {CONTRAT}=“CDD”. There’s no option to type in a value in a formula field. Good luck.

See Solution in Thread

7 Replies 7
Chris-T
6 - Interface Innovator
6 - Interface Innovator

Hi. It’s definitely possible. Can you show your field values and the formula? If not, can you explain what the three “values” are? They can be boolean expressions as well if you need them to be.

Hi Chris, there is my actual formula working :slightly_smiling_face:
IF(AND({ENTITE}=“ONATERA”,{STATUT} =“Cadre”), 3, IF(AND({ENTITE}=“ONATERA”,{STATUT} =“Agent de maîtrise”),2,IF(AND({ENTITE}=“ONATERA”,{STATUT} =“Employé”),1,IF(AND({ENTITE}=“OVALENTINA”,{STATUT} =“Cadre”),3, IF(AND({ENTITE}=“OVALENTINA”,{STATUT} =“Agent de maîtrise”),2,IF(AND({ENTITE}=“OVALENTINA”,{STATUT} =“Employé”),1,IF(AND({ENTITE}=“BIOULTIME”,{STATUT} =“Cadre”),4, IF(AND({ENTITE}=“BIOULTIME”,{STATUT} =“Agent de maîtrise”),3,IF(AND({ENTITE}=“BIOULTIME”,{STATUT} =“Employé”),2)))))))))

I would like to add an other condition like IF({CONTRAT}=“CDD”) none of the previous formulas apply and you must enter by hand in the field. Is it possible ?

It’s really hard to explain , hope you understand the point …

What doeas it mean boolean expressions ?

A boolean expression is any combination of objects & operators that result in a true/false outcome. You use them in your formula in many places (e.g. {STATUT}=“Employé”).

So, your formula is straightforward, but difficult to look at. :grinning: You could simplify it a little, since in both cases where {ENTITE} != ‘BIOULTIME’, the results of the {STATUT} field determine the results. So, it can be simplified to the following, if it helps you to do so:

IF({ENTITE}!=‘BIOULTIME’,SWITCH({STATUT},‘Cadre’,3,‘Agent de maîtrise’,2,‘Employé’,1),SWITCH({STATUT},‘Cadre’,4,‘Agent de maîtrise’,3,‘Employé’,2))

Can you tell me where you would like to consider the value of {CONTRAT}?

Thank u for the tip, i’ll try it
If the {CONTRAT}=“CDI” i want to appply all the previous formula but IF {CONTRAT}=“CDD” i would like to let the field empty or the best of the best (but I don’t know if it’s possible) would like to let yourself enter the data

Chris-T
6 - Interface Innovator
6 - Interface Innovator

Hi Mathilde. If there are only two values for {CONTRAT}, CDI & CDD, then you could use the formula…

(IF{CONTRAT}=“CDI”, IF({ENTITE}!=‘BIOULTIME’,SWITCH({STATUT},‘Cadre’,3,‘Agent de maîtrise’,2,‘Employé’,1),SWITCH({STATUT},‘Cadre’,4,‘Agent de maîtrise’,3,‘Employé’,2)))

This will leave the field empty if {CONTRAT}=“CDD”. There’s no option to type in a value in a formula field. Good luck.

Thank you Chris ! it’s working, i’ll will use SWITCH all the time now :slightly_smiling_face: