The $ signs "lock" that part of the cell reference. $D$2 will remain D2 if you drag the formula right, or down. $D2 will lock it on D as you drag it across, but will change to $D3, $D4 etc as you drag down.