My goal is to use this script in a spreadsheet to calculate how many instances of a particular day are remaining in the current month and return it as a numeric value. For example, as of today, there are exactly 2 Mondays remaining in this month. Within a spreadsheet cell, the script would be called using the format =specificDaysLeft(Today(), "Monday").
Currently, the script seems to return a value of 4, regardless of which day of the week I enter into it. I've been staring at this code long enough to go cross-eyed and I'm sure it's something really simple causing this problem, but I'm burnt out trying to find it. Can anyone give it a look and let me know if they spot the problem?
Educational Technology Specialist
Oxbow High School
P: 802.222.5214 - ext.147