1

On sharepoint online, for a custom list that contains single line of texts columns, i'm trying a simple calculated formula.

=if(1=1,"123")

This fails with SharePoint online error "formula contains errors"

if i try the following:

="1123"

it works.

So if i put any IF then it fails. obviously i need something more complex, as a 12 nested if or and.. but if this basic doesn't work then i can't advance.

Frank
  • 11
  • 2

4 Answers4

1

Basic syntax for IF statement in calculated formula is:

IF(logical_test,value_if_true,value_if_false)

So, try to write down your formula in above format.

Sources:

  1. IF function
  2. SharePoint: Creating Calculated Column Formulas the Easy Way Using Excel.

The second link is very helpful while creating calculated column formula's in SharePoint.

Note:

Sometimes comma(,) does not work in formula (I am not sure but it is based on something language on your site). So in that case use semicolon(;) instead of comma(,).

Ganesh Sanap - MVP
  • 44,918
  • 21
  • 30
  • 61
0

Try:

=IF(1=1;123)

Use " ; " instead of " , ".

Zdeněk Vinduška
  • 2,889
  • 2
  • 12
  • 24
0

Tried this:

 =IF(Type_Reseau="Eau domestique 70 PSI et moins",IF(Type_Essai="Hydrostatique","2 Heures"),IF(Type_Reseau="Eau domestique 70 PSI et moins",IF(Type_Essai="Pneumatique","1 Heure","ERROR")))
frank
  • 1
0

Answer is:

=IF(AND(Type_Reseau="Eau domestique 70 PSI et moins";Type_Essai="Hydrostatique");"2 Heures";
IF(AND(Type_Reseau="Eau domestique 70 PSI et moins";Type_Essai="Pneumatique");"1 Heure";
IF(AND(Type_Reseau="Eau domestique 71@115 PSI";Type_Essai="Hydrostatique");"2 heures";
IF(AND(Type_Reseau="Eau domestique 71@115 PSI";Type_Essai="Pneumatique");"1 heure";
IF(AND(Type_Reseau="Chauffage et eau refroidie";Type_Essai="Hydrostatique");"2 heures";
IF(AND(Type_Reseau="Chauffage et eau refroidie";Type_Essai="Pneumatique");"1 heure";
IF(AND(Type_Reseau="Drainage sanitaire, pluvial, pompé et évent";Type_Essai="Hydrostatique");"15 minutes";
IF(AND(Type_Reseau="Drainage sanitaire, pluvial, pompé et évent";Type_Essai="Fumée");"15 minutes";
IF(AND(Type_Reseau="Gaz naturel";Type_Essai="Hydrostatique");"ERREUR";
IF(AND(Type_Reseau="Gaz naturel";Type_Essai="Pneumatique");"3 heures"
))))))))))