If I understand your question, change the formula in Q34 to

=MMULT( MMULT( ( MINVERSE(MMULT(TRANSPOSE(P), P) ) ),TRANSPOSE(P) ), $Q$8:$Q$16)