Calculating the pH at the endpoint of a titration involving either a weak acid or weak base is worked out in this tutorial. The first example is the last problem (#15) on the Endpoint Calculations worksheet.