# Calculate Weekdays with no weekends

Hey all! I need some help.

I have already have found some solutions from this forum on how to calculate weekdays, however for my project it is just not working, I have already made the extract date and time, applied Date&Time Difference, Strings to Numbers, Rule engine and Math Formulas, I “took out the weekend days” with a rule engine but still counting them. What am I doing wrong?

Math Formula:
1+(\$date&time diff\$*5-(\$Posting Date \$-\$Clearing date \$)*2)/7

Rule Engine:
(\$Posting Date \$ = “Sunday”) AND (\$Clearing date \$ = “Saturday”) => -2
(\$Posting Date \$ = “Sunday”) OR (\$Clearing date \$ = “Saturday”) => -1
TRUE => 0

Math Formula:
\$Temp_WorkDays\$+\$Correction\$

Hi @Yodata , I’m not exactly understanding what you are trying to do. May be some sample of input data and the expected results along with what you are explaining would help.

Also, I’m not quite sure what you are trying to accomplish with this Math Formula:
`1+(\$date&time diff\$*5-(\$Posting Date \$-\$Clearing date \$)*2)/7`

Does this formula give you the expected numbers? If not, you may need to consider adding additional brackets to make sure which operation goes with which operation. When we have addition/subtraction with multiplication/division, you need to make sure that the order of operations is properly set.

Hello yodata,