# a little coding goes a long way

I think a lot of people don’t even start learning to code, because they think they need a four year degree in computer science to be useful.

This is false. Five minutes of programming now can save you hours of mundane grunt work later.

Two of the most useful times I used programming that impressed people the most were both fantastically boring Excel formulas.

The first was a two column formula to calculate and output a student’s final grade. The first column looked something like this:

`=(A2*.25+B2*.25+C2*.5)`

This would be in column D. Columns A and B represent midterms (worth 25% of the final grade), and column C represents the final (worth 50% of the final grade). This returns a weighted average. The formula can be copy/pasted into all the rows, and programs like Excel and Google Sheets automatically update it to be

`=(A3*.25+B3*.25+C3*.5)`

or

`=(A4*.25+B4*.25+C4*.5)`

and so on, for each row.

Then, in column E, a formula like this:

`=IF(D2>97,"A+",IF(D2>92,"A",IF(D2>89.9,"A-",IF(D2>87,"B+",IF(D2>82,"B",IF(D2>79.9,"B-",IF(D2>77,"C+",IF(D2>72,"C",IF(D2>69.9,"C-",IF(D2>67,"D+",IF(D2>62,"D",IF(D2>59.9,"D-","F"))))))))))))`

This formula looks like a mess, but all it does is take the result of column D, and output the letter grade. When I made this Excel spreadsheet for a non-tech savvy professor I was TA’ing for, she basically thought this was magic. Before this formula, the professor was manually calculating weighted averages with an actual calculator, and then reading these numbers and doing head math to pick a letter grade.

Five minutes of programming now can save you hours of mundane grunt work later.

Note that both of these formulas require nothing more than arithmetic and basic if statements. These are both Week 1 of any CS 101 class. You can learn if statements within an hour on codecademy or any other online programming class.

`=len(A2)`