If then/or /and with subtracting

Options
Aimee Colton
Aimee Colton ✭✭✭✭

Hello,

I am trying to figure out a formula to subtract if Travel day = 'Yes' to subtract Submitted HRs - Lunch time, but then also subtract Submitted HRs - Lunch time - Contracted HRs if Travel Day = 'No'.

Bearing in mind that Submitted HRs and Contracted HRs have formulas to get their values.

image.png
Tags:

Answers

  • Naeem Ejaz
    Naeem Ejaz ✭✭✭✭✭✭
    • If Travel Day = "Yes":
      = [Submitted HRs] - [Lunch Time]
    • If Travel Day β‰  "Yes" (i.e., "No"):
      = [Submitted HRs] - [Lunch Time] - [Contracted HRs]

    PMO & Smartsheet Consultant

    naeemejaz@hotmail.com

    00923455332351

  • Aimee Colton
    Aimee Colton ✭✭✭✭

    I have added this formula

    =IF([Travel Day]@row = "Yes", [Submitted HRs]@row - [Lunch Time]@row , [Submitted HRs]@row - [Lunch Time]@row - [Contracted HRs]@row )

    It works for "Yes", but when I switch it to "No", I get # Invalid Operation

    I tried changing it to include VALUE, because the formulas in those cells

    =IF([Travel Day]@row = "Yes", Value[Submitted HRs]@row - Value[Lunch Time]@row , VALUE[Submitted HRs]@row - Value[Lunch Time]@row - VALUE[Contracted HRs]@row )

    and get #unparseable

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!