If P2 and P4 can be assumed to be equal, as are P1 and P3, just calculate flow as I said before.
If you can't make P4 = P2, then you must somehow proportion the unknown flows using an iteration as has already been suggested.
You say you know the flowrate in the header, but don't say at what point that flow is known, so its not easy to tell you exactly how to proceed. Is it known between P1 and P3, or between P3 and P4?
If you know the flow between P1 and P3, then that flow must be proportioned between utility pipe P3-P4 and header pipe P3-P4.
-----------------------------------------------------
If you know the flow in header pipe P3-P4, and apparently you cannot make P4 equal to P2, then you must find the flow in utility pipe P3-P4 by iterating two flow equations.
Equation 1 will be the flow equation for Q utility pipe given the pressure drop of P3 to P4.
Equation 2 will be the flow equation for the header pipe P4-P2, with a flow equal to the sum of the known header flow (Q)between P3-P4 + the unknown flow in the utility pipe.
Solve Equation 1 for P4 using a guess for that flow, then
Solve Equation 2 for P4 using the known flow - the guess.
If both P4 values are not equal, then change the guess a little and see if the difference in the P4 values gets smaller or larger and adjust your guess accordingly.