This adds a 3rd column named "Total" that will be empty. At the end of the contacts the total number of contacts will be found in the "Total" column and the Name and CustomAttribute15 columns will be empty.
$c = 0
Get-Contact -Filter "Department -eq 'Year 8'"|
ForEach-Object{
$c++
Get-MailContact $_.distinguishedname |
Select-Object Name,CustomAttribute15,Total
} | Export-CSV c:\junk\somefilename.csv -NoTypeInformation
[PSCustomObject]@{
Name = ""
CustomAttribute15 = ""
Total = $c
} | Export-CSV c:\junk\somefilename.csv -NoTypeInformation -Append