Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

IF/OR Formula Issue with writing

Hi!

I'm trying to figure out a formula for an IF/OR situation. Basically -- if the [Add-ons] column includes the tag "Prebill," I want the [Final Invoicing Amount] column to be "[Total Project Cost] - [Prebill Actual Invoiced]." If it's NOT tagged "Prebill," I want the [Final Invoicing Amount] column to be "[Total Project Cost] - [FD Actual Invoiced]".

I have a formula that works for the first scenario (not written as an IF formula), but I don't know how to make it into an IF formula that will return the other SUM in the OR situation. Here's the formula I have so far (that works): =SUM([Add-Ons]@row, HAS(@cell, "Prebill"), SUM([Total Project Cost]@row - [Prebill Actual Invoiced]@row))

And this is the formula I want it to perform if [Add-ons]@row does NOT have "Prebill": =SUM([Total Project Cost]@row - [FD Actual Invoiced]@row)

So, in theory it should be something like below, but this isn't working: =SUMIF(([Add-Ons]@row, HAS(@cell, "Prebill"), SUM([Total Project Cost]@row - [Prebill Actual Invoiced]@row)), SUM([Total Project Cost]@row - [FD Actual Invoiced]@row))

Any thoughts or suggestions are appreciated!

Best Answer

  • Community Champion
    Answer ✓

    Hi @Lydia Bowman,

    If your projects are being displayed on a single row, then you could use something like this:

    =IF(HAS([Add-ons]@row, "Prebill"), [Total Project Cost]@row - [Prebill Actual Invoiced]@row, [Total Project Cost]@row - [FD Actual Invoiced]@row)

    Example output:

    If your sheet is somewhat different, is it possible to post an screenshot (obscuring any sensitive data) as an example to work from?

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions