Jun 09, 2021 06:12 AM
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
Solved! Go to Solution.
Jun 10, 2021 06:00 AM
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.
Jun 09, 2021 06:30 AM
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.
Jun 09, 2021 06:35 AM
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 …
Jun 09, 2021 07:03 AM
What doeas it mean boolean expressions ?
Jun 09, 2021 11:06 AM
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}?
Jun 10, 2021 12:38 AM
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
Jun 10, 2021 06:00 AM
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.
Jun 10, 2021 06:39 AM
Thank you Chris ! it’s working, i’ll will use SWITCH all the time now :slightly_smiling_face: