The $ basically locks down the column or row after it - so, in your example
below the $ locks column O and row 2 - if you were to copy the formula down
one row it would look at D41 (instead of D40) but it would still look at O2
because that has been locked....
Hope that makes sense!!