I just had my first exam yesterday, and I'm always tripped with this question that combines neutralization with buffer solution. The task is to find the pH. I did try to understand the general concept behind it. From my understanding, if $\ce{CH3COOH}$ reacts with $\ce{NaOH}$ and the acid has a higher amount of substance ($\pu{0,005 mol}$ vs $\pu{0,004 mol}$), it means that $\pu{0,005 mol}$ of acid is used to neutralize $\pu{0,004 mol}~\ce{NaOH}$, and $\pu{0,001 mol}$ of $\ce{CH3COOH}$ will remain together with $\pu{0,004}~\ce{CH3COONA}$.
To find the pH, one has to use the Henderson-Hasselbach equation and divide the amount of substance with the volume, with $\mathrm{pH} = \mathrm{p}K_\mathrm{a} - (\log c(\ce{CH3COOH})/c(\ce{CH3COONa})$. And then if $\ce{NaOH}$ has a higher amount of substance ($\pu{0,0051 mol}$ vs $\pu{0,005 mol}$ acid), it would create $\pu{0,0001}~\ce{NaOH}$ and $\pu{0,005}~\ce{CH3COONa}$.
So to find the pH, you need to find the pOH of $\ce{NaOH}$ first. So far so good. But in the solution to the problems posted, there's suddenly an acid popping up in the solution and you have to use Henderson/Hasselbach equation. For example $\ce{NH3}$ reacts with $\ce{HCl}$ and creates $\ce{NH4Cl}$, even if you have a bigger amount of substance for $\ce{NH3}$, you still get an acid on the result... I'm so confused. And then there's an example with the coefficient ($\ce{Na2CO3 + 2HCl -> 2NaCL + H2CO3}$). If $\ce{Na2CO3}$ has a higher amount of substance (let's say $\pu{0,224 mol}$) and $\ce{HCl}$ only $\pu{0,0816 mol}$, does it mean that it would result in $0,224 \times 2 - 0,0816 \pu{mol}~\ce{NaCl}$ and $\pu{0,0816 mol}~\ce{H2CO3}$? I feel so stupid now that I can't understand this simple concept and keep making mistakes (and wasted like 8 points during the exam).