I'm not sure if you want the resulting array to only hold the range of months/days that you have data for or if it's OK with an array for the whole year?
In the attached example I've just created a 2D array to hold the whole year, filled it with NaN constants (you could use zeroes instead if that's more convenient for you) and then I use the month and day as indexes to check and replace.
- If the cell at the given indexes alreeady have a value (not equal to NaN in this case) I add it with the new value and replace the cell value.