Forum Discussion

MikeMcCartney's avatar
MikeMcCartney
Qrew Member
4 years ago

Multi level formula

I want to calculate the NFL QB Passer Rating, but not sure best way to do this.  Here is the explained process:



------------------------------
Mike McCartney
------------------------------

3 Replies

  • I believe I got it:

    ((((([Pass Comp]/[Pass Att])-0.3)*5)+
    (((([Pass Yards]/[Pass Att]))-3)*0.25)+
    ((([Pass TD]/[Pass Att]))*20)+
    (2.375-(([Pass INT]/[Pass Att]))*25))/6)*100

    ------------------------------
    Mike McCartney
    ------------------------------
    • AustinK's avatar
      AustinK
      Qrew Commander
      I know you got it figured out but for readability you might consider doing the formula in another way. It helps to not nest things in some many parenthesis. You probably do not even need all of the ones I included below but experiment with that. Sorry if there is a mistake below but it is more to show how to make the formula easier to read for others or even yourself in the future.

      var number passCompletions = (([Pass Comp]/[Pass Att])-0.3)*5;
      var number passYards = (([Pass Yards]/[Pass Att])-3)*0.25;
      var number passTD = ([Pass TD]/[Pass Att])*20;
      var number passINT = (2.375-([Pass INT]/[Pass Att]))*25;

      ($passCompletions + $passYards + $passTD + $passINT / 6) * 100
      • MikeMcCartney's avatar
        MikeMcCartney
        Qrew Member
        This is great Austin.  Thank you!

        ------------------------------
        Mike McCartney
        ------------------------------