Important Multiple Line Considerations
Using multiple lines to write your formulas provides many advantages. Here are some considerations to keep in mind.
All lines are always executed (sort of)
It means the formula below will write 2 to {Column}.
1:{Column}=50
...
24:{Column}=100
Sort of? Well, you may wonder if there is a way to stop the execution at a certain line when a condition is met. There is. See Using Stop, Skip and Resume for all details.
The order of the lines impacts the result
Consider this example: the formula assigns High then Very High to {Column}, so in the end Very High will be written to {Column}.
1:{Column}=IF(125>50,"High").
2:{Column}=IF(125>100,"Very High")
But if we reverse the order of the lines, the final result becomes High.
1: {Column}=IF(125>100,"Very High")
2: {Column}=IF(125>50,"High")
Use multiple lines to avoid embedded functions
An embedded function is a function within another function. You have no choice to use them when working in a one-line environment a.k.a. in monday.com.
Here is a simple example of a Formula column syntax taken from the monday.com community Web site.
Not exactly user-friendly... 😓 The parentheses can be difficult to manage, as we could end up with three, four, or even five closing parentheses in a row. Forgetting just one can cause the formula to produce an error! And when it comes to figuring out which one is missing, you are on your own.
Here is how we could write that same formula using multiple lines:
1:[A]=IF({New Feature}="Yes",300,0)
2:[B]=IF({Data Integration}="Yes",10,0)
3:[C]=IF({Wearable}="Yes",10,0)
4:[D]=IF({Provisioning}="Yes",10,0)
5:[E]=MULTIPLY({Num Languages}, 10)
6:[F]=MULTIPLY({Num Countries}, 10)
7:[G]=MULTIPLY({Num ePRO}, 10)
8:[TOTAL]=SUM([A],[B],[C],[D],[E],[F],[G])
9:{TargetField}=IF({Express}="Yes",0,[TOTAL])
Or we could even be more verbose and write it like this:
1:[A]=0
2:[B]=0
3:[C]=0
4:[D]=0
5:[A]=IF({New Feature}="Yes",300)
6:[B]=IF({Data Integration}="Yes",10)
7:[C]=IF({Wearable}="Yes",10)
8:[D]=IF({Provisioning}="Yes",10)
9:[E]=MULTIPLY({Num Languages}, 10)
10:[F]=MULTIPLY({Num Countries}, 10)
11:[G]=MULTIPLY({Num ePRO}, 10)
12:[TOTAL]=SUM([A],[B],[C],[D],[E],[F],[G])
13:{TargetField}=IF({Express}="Yes",0,[TOTAL])
Since you are many lines to write your formula, do not hesitate to use them. If it makes it easier to understand and modify if needed, why not?