# 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)`