This should work on any day of any year in any version of Excel until year 2078 (much longer in Excel 2007 or later).
=SUM(IF(DAY(ROW(OFFSET($A$1,TODAY(),0,DATE(YEAR(TODAY()),12,31)-TODAY()+1)))={1,16},1,0))
Note I'm checking for day = 1 or 16 on an offset of 1 day (the idea was to get around varying end-of-month DAY()
values).
{Array formula... Press Ctrl+Shift+Enter
to commit}
[addendum]
If you do not want to include the current day (e.g., say today is 15 August), use this instead:
=SUM(IF(DAY(ROW(OFFSET($A$1,TODAY()+1,0,DATE(YEAR(TODAY()),12,31)-TODAY()+1)))={1,16},1,0))
P.s. I tested on all dates from today through leap day 2016 and beyond and it works a treat. All this does is test row numbers treated as a date serial by the DAY()
function to see if they are 1 or 16, but the serial is offset by +1 so it's really checking to see if DAY()
is [last day of whatever month] or 15. If the result is true, add 1, else add 0.
[more addenda]
Here are non-array versions that otherwise work the same way:
Includes the current day:
=SUMPRODUCT(N(DAY(ROW(OFFSET($A$1,TODAY(),0,DATE(YEAR(TODAY()),12,31)-TODAY()+1)))={1,16}))
Excludes the current day
=SUMPRODUCT(N(DAY(ROW(OFFSET($A$1,TODAY(),0,DATE(YEAR(TODAY()),12,31)-TODAY()+1)))={1,16}))