# Create a Condition and calculate working days

I have a list with several dates' columns. I need to calculate working days I am using the following formula:

``````=DATEDIF([Fecha01],[Fecha02],"D")-IF(WEEKDAY([Fecha02])=7,FLOOR((DATEDIF([Fecha01],[Fecha02],"D")+WEEKDAY([Fecha01]))/7,1)*2,FLOOR((DATEDIF([Fecha01],[Fecha02],"D")+WEEKDAY([Fecha01]))/7,1)*2+1)+IF(WEEKDAY([Fecha01])=7,2,1
``````

It works perfect but I need to add a condition it is, if column1>column2 = 0 How can I add this condition to the current formula?

• I found the solution, the formula is =IF(ISERROR(DATEDIF([Fecha01],[Fecha02],"D")-IF(WEEKDAY([Fecha02])=7,FLOOR((DATEDIF([Fecha01],[Fecha02],"D")+WEEKDAY([Fecha01]))/7,1)*2,FLOOR((DATEDIF([Fecha01],[Fecha02],"D")+WEEKDAY([Fecha01]))/7,1)*2+1)+IF(WEEKDAY([Fecha01])=7,2,1)),"0",DATEDIF([Fecha01],[Fecha02],"D")-IF(WEEKDAY([Fecha02])=7,FLOOR((DATEDIF([Fecha01],[Fecha02],"D")+WEEKDAY([Fecha01]))/7,1)*2,FLOOR((DATEDIF([Fecha01],[Fecha02],"D")+WEEKDAY([Fecha01]))/7,1)*2+1)+IF(WEEKDAY([Fecha01])=7,2,1)) – Elena Mª Mora Apr 14 '16 at 13:03

`=IF([Fecha01]>[Fecha02],(DATEDIF([Fecha01],[Fecha02],"D")-IF(WEEKDAY([Fecha02])=7,FLOOR((DATEDIF([Fecha01],[Fecha02],"D")+WEEKDAY([Fecha01]))/7,1)*2,FLOOR((DATEDIF([Fecha01],[Fecha02],"D")+WEEKDAY([Fecha01]))/7,1)*2+1)+IF(WEEKDAY([Fecha01])=7,2,1),0)`

• If that isn't what you wanted, clarify what you want to happen if the 2nd column is or isn't greater than the 1st. – Erin L Apr 13 '16 at 13:45
• Thank you very much Erin but It is not working. SharePoint shows a error message "The formula contains a syntax error or is not supported" – Elena Mª Mora Apr 14 '16 at 12:52