Ok, first, to get the total from Sheet2 is simple: Use SUMIF instead of AVERAGEIF.
The number of months from 2012-06 to now: I'm sure there must be a built-in Excel function for that. Let me look... No, apparently not. But
this article at Microsoft Support lists a formula that'll do it using the YEAR and MONTH functions.