Question: Using the openpyxl Python module, I need to open an excel file with the data in the table provided below. I then need to use
Using the openpyxl Python module, I need to open an excel file with the data in the table provided below. I then need to use the COM, ATT, YDS, TD and INT to calculate Passer Rating - the formula for which I have also provided below. Once calculated, I need to write back to the excel file in a new column. Can you please assist with the Python code needed to accomplish this?

| Player | COMP | ATT | YDS | TD | INT |
| Patrick Mahomes II (KC) | 30 | 39 | 360 | 5 | 0 |
| Josh Allen (BUF) | 26 | 31 | 297 | 3 | 2 |
| Carson Wentz (WAS) | 27 | 41 | 313 | 4 | 2 |
| Jalen Hurts (PHI) | 18 | 32 | 243 | 0 | 0 |
| Justin Herbert (LAC) | 26 | 34 | 279 | 3 | 0 |
| Joe Burrow (CIN) | 33 | 53 | 338 | 2 | 4 |
| Jameis Winston (NO) | 23 | 34 | 269 | 2 | 0 |
| Lamar Jackson (BAL) | 17 | 30 | 213 | 3 | 1 |
| Kyler Murray (ARI) | 22 | 34 | 193 | 2 | 0 |
| Marcus Mariota (ATL) | 20 | 33 | 215 | 0 | 0 |
| Ryan Tannehill (TEN) | 20 | 33 | 266 | 2 | 0 |
| Kirk Cousins (MIN) | 23 | 32 | 277 | 2 | 0 |
| Baker Mayfield (CAR) | 16 | 27 | 235 | 1 | 1 |
| Russell Wilson (DEN) | 29 | 42 | 340 | 1 | 0 |
| Geno Smith (SEA) | 23 | 28 | 195 | 2 | 0 |
| Daniel Jones (NYG) | 17 | 21 | 188 | 2 | 1 |
| Derek Carr (LV) | 22 | 37 | 295 | 2 | 3 |
| Jared Goff (DET) | 21 | 37 | 215 | 2 | 1 |
| Matt Ryan (IND) | 32 | 50 | 352 | 1 | 1 |
| Davis Mills (HOU) | 23 | 37 | 240 | 2 | 0 |
| Joe Flacco (NYJ) | 37 | 59 | 309 | 1 | 1 |
| Tua Tagovailoa (MIA) | 23 | 33 | 270 | 1 | 0 |
| Justin Fields (CHI) | 8 | 17 | 121 | 2 | 1 |
| Trevor Lawrence (JAC) | 24 | 42 | 275 | 1 | 1 |
| Mitch Trubisky (PIT) | 21 | 38 | 194 | 1 | 0 |
| Tom Brady (TB) | 18 | 27 | 212 | 1 | 1 |
| Trey Lance (SF) | 13 | 28 | 164 | 0 | 1 |
| Jacoby Brissett (CLE) | 18 | 34 | 147 | 1 | 0 |
| Matthew Stafford (LAR) | 29 | 41 | 240 | 1 | 3 |
| Mac Jones (NE) | 21 | 30 | 213 | 1 | 1 |
| Dak Prescott (DAL) | 14 | 29 | 134 | 0 | 1 |
| Aaron Rodgers (GB) | 22 | 34 | 195 | 0 | 1 |
| Cooper Rush (DAL) | 7 | 13 | 64 | 0 | 0 |
| Jordan Love (GB) | 4 | 5 | 65 | 0 | 0 |
| Trace McSorley (ARI) | 2 | 4 | 12 | 0 | 0 |
a b= COMP ATT C = YDS ATT TD - (ATT) -.3 x 5 - 3) x 0.25 d = 2.375- X 20 INT ATT x 25
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
