Since the year is already closed, the only thing you can do is indicate on the W-2c the amount of the 401k contributions actually made. You can't go back and recompute the amounts based on percentages or anything like that. So the amount that was actually sent to the 401k company and taken out of his gross pay is the number that should appear in Box 12 of the W-2.
Was this a Roth 401K contribution or just a traditional 401k contribution? The only difference on the W-2 would be the code letter.
Do not take into account any company matches to the 401k. The only part that goes on the W-2 is the actual employee contribution amounts.
You may need to go through each paycheck and add up the deductions from each weekly or bi-weekly paycheck.
You will need to print out the employee's paycheck records for the year and add up the contributions deducted from the checks. Every paycheck created should have a breakdown of gross pay and all deductions.
There is no "calculation" other than that.
What calculations are you trying to find?
Social Security taxes are not affected by nor do they affect retirement account amounts.
However, in GENERAL,
Box 1 Wages = Gross Wages minus pretax 401k (but NOT Roth 401k contributions)
Box 2 Federal Tax WH = no formula. Based on tables
Box 3 SS Wages = Gross Wages no subtractions for 401k.
Box 4 SS Tax withheld = should be Exactly 6.2% of Box 3 but not more than $6,324
Box 5 Medicare Wages = Should be the same as Box 3
Box 6 Medicare Tax = Exactly 1.45% of Box 5
There are no other formulas for a W-2/paycheck calculation.
Box 1 Gross wages is reduced by a few other things, notably any pre-tax healthcare (Section 125). Boxes 3 and 5 are similarly affected.
However, Boxes 3,4,5, and 6 do not affect a taxpayer's tax return
AND Boxes 3,4,5 and 6 are supposed to mesh with Forms 941 sent in quarterly.