I wish to find the number of rectangles that don't contain the shaded square:
Image of the grid:

I used the way of finding the total number of rectangles and subtracting the rectangles containing the square. I can't calculate the latter.
I'd be grateful if someone helped me.
Label the vertical lines in the grid from left to right, starting from $1$ upto $9$. Similarly label the horizontal lines from top to bottom, from $1$ to $6$.
Now, the black square is formed by intersection of the $5^{th}$ and $6^{th}$ vertical lines with the $3^{rd}$ and $4^{th}$ horizontal lines.
If the rectangle chosen should not contain the black square, the 2 vertical lines for making a rectangle should be chosen either from the set of vertical lines labelled {$1, 2, 3, 4, 5$} OR {$6, 7, 8, 9$}. Hence the total number of options for choosing the vertical lines is $\binom{5}{2} + \binom{4}{2}$.
Similarly, for horizontal lines, we have $\binom{3}{2} + \binom{3}{2}$.
Hence, the total number of options is :
$[\binom{5}{2} + \binom{4}{2}][\binom{3}{2} + \binom{3}{2}]$