40.0ml of 0.200M HCl reacts with 20.0ml of 0.100 M NaOH. Calculate the pH of the resulting solution.
After caculations, we find that there are 0.008 mol of HCl and 0.002 mol of NaOH. From here I get lost, that means that HCl was in excess and in reality only 0.002 mol of HCl reacted with the NaOH because it's a 1:1 ratio. Consequently I thought that would produce 0.002 mol H3O+ because again, 1:1 ratio so I subbed that into c = n/v to find the concentration. But in the answers why is the 0.006 mol excess HCl used in the c = n/v equation? Did I make a really silly mistake? Thaaankss 
I think you are getting confused with H3O+ forming. When an acid reacts with a base, water is produced, not H3O+. The reaction is HCl + NaOH --> H2O + NaCl.
HCl is a strong acid, it ionises almost 100%. HCl + H2O --> H3O+ + Cl-. ). 0.008 mole of HCl will form 0.008 mole of H3O+. In the reaction with NaOH, the limiting reagent being the NaOH, only 0.002 mole of the 0.008 H3O+ will react, leaving 0.006 mole H3O+/H+ left in the solution.
The pH will be the -log[H3O+] concentration. This concentration is derived by going [0.006mole H3O+]/[0.060L]