Forum Discussion
run multiple statements in if then else
- 4 years ago
You cannot do two things in a custom column. You can test two or more things, but the thing you do is one thing, one formula. What you are saying is:
if [Start Time] has a "+" symbol, then return [Start Time] and replace the "+" with a ",", and also return the [Date] plus one day, so you are asking to return two things to one column. Cannot do it.
You'd to add two custom columns, each doing one thing.
You can test multiple things though, so as an example:
if Text.Contains([Start Time],"+") and Date.AddDays([Date],1) > DateTime.Date(DateTime.LocalNow()) then do-something-here else do-something-elseThat would only do "do-something-here" if the Start Time had a "+" symbol and the [Date] was in the future, otherwise it woudl "do-something-else"
But you cannot do 2 things. Only 1.
You cannot do two things in a custom column. You can test two or more things, but the thing you do is one thing, one formula. What you are saying is:
if [Start Time] has a "+" symbol, then return [Start Time] and replace the "+" with a ",", and also return the [Date] plus one day, so you are asking to return two things to one column. Cannot do it.
You'd to add two custom columns, each doing one thing.
You can test multiple things though, so as an example:
if Text.Contains([Start Time],"+") and Date.AddDays([Date],1) > DateTime.Date(DateTime.LocalNow()) then
do-something-here
else
do-something-else
That would only do "do-something-here" if the Start Time had a "+" symbol and the [Date] was in the future, otherwise it woudl "do-something-else"
But you cannot do 2 things. Only 1.