Probably the better way to approach this presuming a new (>=R2014) would be to convert the array to a table and use grouping variables over which to compute the desired statistics.
If you're on an earlier release and hence don't have this facility, I would make a multi-dimensional array of month,day,year,station where the day dimension is 31 to accomodate the longest month, but fill in the shorter month's values with NaN and use the nanXXX functions over the proper dimension(s) of the array to compute the desired statistics. Eases the above computational burden significantly.
It is, of course, also possible to do grouping with accumarray and friends.
It's not the most friendly data organization possible, but...
filename = 'rainfalldate.xlsx';
[Y,M] = datevec(datenum(txt,'dd/mm/yyyy'));
[u,~,ix] = unique([Y,M],'rows');
tot = [u, accumarray(ix,data(:,2)];
You may have to fix up the references to the data columns I just used data(:,2) assuming the 'B' column is also numeric. If you're going to keep the multiple files, I'd also point you to the File Exchange submission FILEFUN: APPLY A FUNCTION TO FILES
NB: tot above will be an array containing the year, month and totals for that month in the three columns, respectively, in that it concatenates the results from unique to get the month info in direct confluence with the associated sum.