This is fork of Abhisheks answer :) Nearly same as his logic but the date functions are a little changed.
I use formatDateTime to get the Day of the week from the date and then work with it till end date, all the time checking for weekend(assuming weekend on Sat and Sun)
Download this Microflow export, import and and use/modify as per your needs.
Implementing this function using a formula might be complicated but you can achieve your requirement using loop.
Let me explain in steps;
1. Create a variable of type date with initial value as start date and create a count variable.
2. Check if the trimtoday($variable) = 1 or 7.
3. If true continue the loop by using change variable by add date 1.
4. Else increment the count.
5. This loop will execute until variable < end date.
6. The count variable will be the days between start and end.
Hope my answer helps. Reach me out for any queries.
You can try this https://marketplace.mendix.com/link/component/116770 to see if it meets your requirement.