Question

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?

Was it helpful?

Solution

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"),"")

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top