What's the ammount of solutions to the Equation $A+B+C+D=24$ with restrictions on $A$ and $B$ As the title says, I have the the following equation:
$A+B+C+D=24$
$2\leq A\leq 5$ and $4\leq B\leq 7$
And i need to find the number of possible solutions. $A,B,C,D\geq 0$, They are integers.
I'm not sure if my solution is right, What i did is:
I've made a new equation stating $A_1=A-2$ and $B_1=B-4,$ So i get:
$A_1+B_1+C+D=30.$
So my restrictions now are $0\leq B \leq 3$, Marking $A_1+B_1=S, S=[0,6],$ Means:
$C+D=30-S $ And the number of possibilities for that one is $31-S$.
So now i need to do the sum: $\sum (31-S)$ from $S=0$ to  $ S=6$ and multiply it by $3^2 \;$ [Which represents the different combinations of $A$ and $B$] so that equals to: $1774.$
Did I do something wrong or it seems fine?

You've had a good idea to set $A_1=A-2$ and $B_1=B-4$, but from there, you start having issues. We can rewrite $A=A_1+2$ and $B=B_1+4$ to give us $$A_1+B_1+C+D+6=24,$$ or $$A_1+B_1+C+D=18,\tag{1}$$ with our new constraints that $A_1,B_1,C,D$ are all nonnegative integers with $A_1\le3$ and $B_1\le 3$.
As you note in the comments, there are $16$ pairs $A_1,B_1$ that meet our constraints. However, there are not $16$ different ways to make $A_1+B_1=S$ for each integer $0\leq S\leq 6$. Consider the following table of sums: $$\begin{array}{c|cccc}& 0 & 1 & 2 & 3\\\hline\\0 & 0 & 1 & 2 & 3\\1 & 1 & 2 & 3 & 4\\2 & 2 & 3 & 4 & 5\\3 & 3 & 4 & 5 & 6\end{array}$$ In general, then, given an integer $0\le S\le 6$, there are $$\min\{S,6-S\}+1=4-|3-S|$$ ways to choose $A_1,B_1$ meeting our constraints such that $A_1+B_1=S$.
Now, given any integer $0\le S\le 6,$ there are indeed $19-S$ ways to choose nonnegative integers $C,D$ such that $S+C+D=18$. Hence, the sum you're looking for is $$\begin{align}\sum_{S=0}^6\bigl(4-|3-S|\bigr)(19-S) &= 1\cdot 19+2\cdot 18+3\cdot 17+4\cdot 16+3\cdot 15+2\cdot 14+1\cdot 13\\ &= 19+36+51+64+45+28+13\\ &= 256.\end{align}$$
