Complex IF statement using columns containing formulas

Hi Everyone,

Hoping there is a solution for this or a different way I can accomplish it.

I have an IF statement in a column where the False portion is a formula referencing two columns that are formulas. I get #Invalid Operation. I know it's due to the false portion based on testing the conditions in the IF statement and just testing out a simple formula rather than the whole IF statement where I subtracted the two columns and got same error.

The formula I'm using in the column with the error is:

=IF(AND(ISBLANK([Start POI]@row), [Rule Type]@row = "Speed Limit"), ([Speed Limit (km/h) Final]@row - [Speed (km/h)]@row), IF(AND(ISBLANK([Start POI]@row), [Rule Type]@row <> "Speed Limit"), "", [Speed Limit (km/h) Final]@row - [POI Speed Limit]@row))

Any ideas or help would be much appreciated. Thank you!!


Best Answer

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Answer ✓

    Try:

    =IF(AND(ISBLANK([Start POI]@row), [Rule Type]@row = "Speed Limit"), (VALUE([Speed Limit (km/h) Final]@row ) - VALUE([Speed (km/h)]@row)), IF(AND(ISBLANK([Start POI]@row), [Rule Type]@row <> "Speed Limit"), "", value([Speed Limit (km/h) Final]@row) - value([POI Speed Limit]@row)))

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

Answers

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Answer ✓

    Try:

    =IF(AND(ISBLANK([Start POI]@row), [Rule Type]@row = "Speed Limit"), (VALUE([Speed Limit (km/h) Final]@row ) - VALUE([Speed (km/h)]@row)), IF(AND(ISBLANK([Start POI]@row), [Rule Type]@row <> "Speed Limit"), "", value([Speed Limit (km/h) Final]@row) - value([POI Speed Limit]@row)))

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • alexis.ray89371
    alexis.ray89371 ✭✭✭✭✭

    That worked! Thank you so much!

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭

    Glad you found a solution. Thank you for contributing to the Community.

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!