As you read in the title, the goal is to find a formula that gives a number of integers congruent to n mod p between a and b.

For example, if $(a,b)=(0,100)$, there are $51$ congruent integers $0$ mod $2$ between $0$ and $100$ inclusive.
If $(a,b)=(32,456)$, there are $106$ congruent integers $2$ mod $4$ between $32$ and $456$ inclusive.

Is there already a formula? And if so, what is that formula?

With a little research, we can find for integers at 0,1 mod 2, for integers at 0,1,2 mod 3, etc... But it must certainly have a pattern to find a formula.