0

I'm working on a list in SharePoin 2010.

I need to know how long a job has been open before it glot closed. I also need it to count how many days it has been open if it hasn't been closed yet. This formula counts how many days it has been since it opened:

=DATEDIF([Date Raised],[Todays Date],"d")

and this is what I had in mind to stop the count when it got closed

=DATEDIF(([Status]="Open")[Date Raised],[Todays Date],"d")

The idea being that if the status = open, then count the days. This is obviously incorrect as I get an error message informing me so.

How do I get it to work?

1

Sharepoint calculated fields are close to EXCEL formulas, so I guess the IF function will work. something like this.. (Haven't tried it)

=IF([Status]="Open",DATEDIF([Date Raised],[Todays Date],"d"),"")

  • Thanks, it seems to be working. I'll give it some proper testing, but the initials signs are good. – Ben Feb 14 '14 at 8:37
0

I also need it to count how many days it has been open if it hasn't been closed yet.

Please remind that formulas are only evaluated when the item has been changed. The formula posted by Burhuss should work initialy but the value will not change over time (as long as the item is not being edited).

You might want to take a JS or Workflow approach here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.