This claculator uses this formula to determine the pressure loss due to pipe friction.
Reference: Washington State University