On the column containing "P" or something else, I used MATCH to find the biggest row number with data. Assuming that Column is B in the sample file, it will be like this
=MATCH(REPT("z",255),B:B)
What this formula does is, lookup a word consisting of 255 letter "z" (which will never be found), but return the approximated row number, not exact, thus it will return the closest row to the end of the worksheet, or you can say the last row with data in column B.
Let's called what we just found X, then the COUNTIF is really simple
=COUNTIF(INDIRECT("C"& X - 49 & ":C" & X ),"P")/50
The INDIRECT is a formula to assemble together a reference.
Assuming your last row with "P" or something else on Column B, X = 53, then the INDIRECT will assemble "C" with "4" (53 - 49), with ":C" and "53", then you have "C4:C53", last 50 rows!
And the last job belongs to COUNTIF. What it does is what you think it is - the good old COUNTIF will count the number of "P" on the reference assembled by INDIRECT. the /50 at the end of the formula is to divide the results with 50, turning it into percentage.
If you still have trouble, can you provide a small sample of your live file? You can change the name and all personal data, just make it like "insert something here" or "Bob" or even "Iron man". And just about couple of rows will do it (at least 50!)
Bookmarks