Defensive Yards Allowed are calculated by Total Net Yards, which is the sum of Net Yards Rushing + Net Yards Passing.
We're going to use the Pittsburgh Steelers DEF as an example. In Week 1 of 2019, they allowed 465 yards to the New England Patriots.
So how do we get to the 465 yards allowed?
We use the official NFL gamebook to accurately match any statistics. There is a stat listed for Total Net Yards, which in this case, the Patriots had 465.
Total Net Yards is the sum of Net Yards Rushing + Net Yards Passing.
In this example, the Patriots had 99 Net Yards Rushing and 366 Net Yards Passing, for a total of that 465 I mentioned.
Here is how the Patriots reached the 99 Net Yards Rushing:
For the Net Yards Passing, you'll see here that their total actually comes out to 373. However, sack yardage is taken into account because it was considered to be a potential pass.
Since Brady was sacked one time for seven yards, those yards come off of the 373, bringing us back to the 366 Net Yards Passing.
By default, the yards allowed for defenses are NOT impacted by punt or kick returns, as the actual defensive unit is not on the field for those. You can choose to have those applied, though, by using the Special Teams Defense scoring section in the settings.
By including punt and kick return yards, you would have those added to your yards allowed total. Using our example, the Steelers would have a total of 70 more yards allowed due to 35 punt return yards and 35 kick return yards.
So, instead of the 465 Total Net Yards allowed, that would increase to 535 defensive yards allowed in your fantasy matchup.