Forum Discussion

CassieHubble's avatar
CassieHubble
Qrew Cadet
3 years ago

I need help with an IF statement.

I need a total time worked for the day. But not all employees take a lunch. Right now this formula comes up blank if the employee didn't take a lunch. 
Total Day Worked=[Time Worked Formula]-[Lunch Formula]
I know I need an IF statement but not sure how to write it.

------------------------------
Cassie Hubble
------------------------------

2 Replies

  • One way to fix this is to fix the [Lunch Formula] field so that it calculates to a zero instead of a blank when the employee did not take a lunch. But if you want to kind of patch your existing formula you can do this  

    Total Day Worked=[Time Worked Formula] - Nz([Lunch Formula])

    The function Nz (.....) Will convert any Null values into a numeric Zero

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • CassieHubble's avatar
      CassieHubble
      Qrew Cadet
      Thanks, Mark that worked perfectly!

      ------------------------------
      Cassie Hubble
      ------------------------------