# Calculating “Task Aging” without weekends

I am calculating the number of days a task is aging.

This works great:

``````=DATEVALUE(TEXT(NOW(),"mm/dd/yyyy")) - DATEVALUE(TEXT([Created],"mm/dd/yyyy"))
``````

However, I need the counting to STOP when the `Completed Date` is entered, so code only counts as long as `COMPLETED_DATE=""`.

I would also like to exclude weekends.

Thank you!

• I tried the formula that you posted and it actually computed the correct aging count. However when you input the completion date it will count including "from the received date" and not after it. So for example: if the request was received 09/25 the RCT count appears 3 (which is correct). Then if you input completion date at 09/30 it will count 4 (which it will count the from 25th, 26th, 27th and 30th). Anything you can assist me with this query? Thank you...v – England Ken Fernandez Sep 30 '19 at 15:23

``````=IF(ISBLANK([Completed Date]),IF(ISERROR(DATEDIF([Created],NOW(),”d”)),””,(DATEDIF([Created],NOW(),”d”))+1-INT(DATEDIF([Created],NOW(),”d”)/7)*2-IF((WEEKDAY(NOW())-WEEKDAY([Created]))<0,2,0)-IF(OR(AND(WEEKDAY(NOW())=7,WEEKDAY([Created])=7),AND(WEEKDAY(NOW())=1,WEEKDAY([Created])=1)),1,0)-IF(AND(WEEKDAY([Created])=1,(WEEKDAY(NOW())-WEEKDAY([Created]))>0),1,0)-IF(AND(NOT(WEEKDAY([Created])=7),WEEKDAY(NOW())=7),1,0)),IF(ISERROR(DATEDIF([Created],[Completed Date],”d”)),””,(DATEDIF([Created],[Completed Date],”d”))+1-INT(DATEDIF([Created],[Completed Date],”d”)/7)*2-IF((WEEKDAY([Completed Date])-WEEKDAY([Created]))<0,2,0)-IF(OR(AND(WEEKDAY([Completed Date])=7,WEEKDAY([Created])=7),AND(WEEKDAY([Completed Date])=1,WEEKDAY([Created])=1)),1,0)-IF(AND(WEEKDAY([Created])=1,(WEEKDAY([Completed Date])-WEEKDAY([Created]))>0),1,0)-IF(AND(NOT(WEEKDAY([Created])=7),WEEKDAY([Completed Date])=7),1,0)))