egspen2 wrote: ``even though I don't actually work 30 or 31 days in a month, I'm paid for that amount of days``
I think you mean: you should be paid for the entire month.
And that is exactly my point: if you are salaried monthly (or any multiple) and you terminate employment on the last workday of the month, you should be paid an entire month's salary.
For example, if the last workday of Nov is Wed the 26th because Sun is the 30th and the 27th and 28th are paid company holidays (for Thanksgiving in the US), I believe you should be paid for the entire month.
But I think the algorithm that you described and that HansV implemented would pay only 26/30 of a month's salary.
-----
That said, you are right to a degree: the proration of partial starting and terminating months very much depends on company policy and applicable labor law, and not necessarily on the number of workdays in the month (ostensibly what the Excel function NETWORKDAYS can return).
For example, at the company that I worked for (for 37 years!), if a monthly-salaried employee starts on the last workday on or before the 15th of a month, he/she is paid for the entire month.
And if a monthly-salaried employee terminates on the first workday on or after the 15th of a month, he/she is paid for the entire month.
In the rare instance where a salaried employee cannot abide by those limitations, the month's pay was determined by prorating the monthly salary by the number of workdays in the month (ostensibly NETWORKDAYS). For my Nov example above, that would salary divided by 26, not 30, per workday.
-----
But I digress and perhaps over-complicate things to help you to better understand the point of my original question.
I raised the question merely to ensure that you did your due diligence about what rules should apply.
If this is a class exercise, follow its rules.
If this is a real-life problem and you fully understand the rules, nothing that I wrote matters.
And If now you have some doubts, again nothing that I wrote matters.
But hopefully it encourages you to ask the right questions of the right people (or labor laws) to determine the rules that you should apply.
Good luck!