Discussions

 View Only
  • 1.  Multi level formula

    Posted 08-21-2020 08:26
    I want to calculate the NFL QB Passer Rating, but not sure best way to do this.  Here is the explained process:



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


  • 2.  RE: Multi level formula

    Posted 08-21-2020 20:54
    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
    ------------------------------



  • 3.  RE: Multi level formula

    Posted 08-25-2020 14:44
    Edited by Austin K 08-25-2020 14:45
    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



  • 4.  RE: Multi level formula

    Posted 08-27-2020 16:16
    This is great Austin.  Thank you!

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