How do I make this work? If( IsNull([Date Complete]) and [Status]="Completed",ToDate([Date Modified]), [Date Complete])

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
This is the formula that I have. I don't know why it keeps throwing errors/

If(
IsNull([Date Complete]) and [Status]="Completed",ToDate([Date Modified]),
[Date Complete])
Photo of Meredith Moore

Meredith Moore

  • 556 Points 500 badge 2x thumb
  • frustrated

Posted 2 years ago

  • 0
  • 1
Photo of @lin

@lin

  • 840 Points 500 badge 2x thumb
the formula looks to be in order. What is the error you are getting?
What is the type of the field you are creating?
Photo of Meredith Moore

Meredith Moore

  • 556 Points 500 badge 2x thumb
I'm in my tasks. I am losing my mind on this... :(

---------------------------------------------------------------------------------------------------------------------
Formula error -- Bad or missing arguments in function call

The types of the arguments or the number of arguments supplied do not meet the requirements of the function If.

The function is defined to be If (Boolean condition1, result1, ..., else-result).

You may need to do one of the following to fix the problem:
  • Choose the right number and type of arguments.
  • Use a type conversion function to convert the arguments you are using to the correct type.
  • Choose a different function.
Photo of @lin

@lin

  • 840 Points 500 badge 2x thumb
Make sure the formula type is formula date. I just replicated your situation on one of my apps
 and I got no complaint from it...
What field type is Date Completed.

Maybe it is a date / time field type and it needs to be a Date type.
Photo of Meredith Moore

Meredith Moore

  • 556 Points 500 badge 2x thumb
It is on Work Date formula, tried it as Date formula too, still not working.

Date Completed is a user input date field. 
Photo of @lin

@lin

  • 840 Points 500 badge 2x thumb
Try adding a ToDate before [DateComplete]
maybe like this?

If(IsNull([Date Complete]) and [Status]="Completed",ToDate([Date Modified]),
ToDate([Date Complete]))