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.

Recently, I impressed a coworker with another formula. It was this:

=len(A2)

Put into column B, it outputs the length, in characters, of the sentences in column A. Before this, this coworker was manually doing word counts and manually entering the number. If something got edited, this process would have to be repeated.

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

You must be logged in to leave a reply.