Forum Discussion

AlexBennett3's avatar
AlexBennett3
Qrew Trainee
5 years ago

If Statement on Rich Text - Formula

Hey Everyone,

I'm running into an issue, I'm attempting to total up some durations that are being calculated across multiple fields (7), that way I can figure out overall duration for a job. I keep getting errors trying to use an if statement. I'm trying to use an if statement to say if there is no value, then to display 0. 

Thanks,

------------------------------
Alex Bennett
------------------------------
    • AlexBennett3's avatar
      AlexBennett3
      Qrew Trainee
      (ToText(Ceil([6. Sub Duration]/8) & " " & "Days"))

      So this is the code to take the final number and display it in days. If I try to add an If statement to that to say if that result is blank, then display 0 I get errors

      ------------------------------
      Alex Bennett
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        What does this formula now display when [6. Sub Duration] is blank?   I suppose that it just says "Days".

        try this

        var text Result = (ToText(Ceil([6. Sub Duration]/8) & " " & "Days"));

        IF(Trim($Result)="", "0 Days", $Result)


        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------