Excel to Python — How Easy?

Stephen Strawbridge
4 min readDec 11, 2020

Written by Stephen Strawbridge, CPA

Background: In September of 2018, I entered into the world of public accounting at Ernst & Young (EY), which inevitably involved becoming (quickly) proficient in Microsoft Excel. The vast majority of my days at EY involved financial data manipulation in Excel. For reasons beyond the scope of this article, I bid adieu to EY and enrolled in a data science immersive course with General Assembly.

Present: Suddenly, I’m required to learn computer programming, specifically Python (also very quickly), with no prior experience in computer programming. I wonder: will any of my experience in Excel assist me in learning Python as needed for data science? This is a question that many people have when transitioning to a computer-science position from a previous corporate desk job that did not require coding. In this article, I list the main realizations I came to in my personal experience with this question.

1) Both Excel and Python require the ability to quickly interpret very large amounts of information/data

Excel — Assuming that you are like many individuals working with large Excel tabs, you are probably not going to read through each cell in a tab, take notes, and come to a conclusion after reading each cell. Rather, people using Excel take a high-level look at the information, and search for key features (such as total sum, variances, column headers, keys or legends). Rarely do people perform calculations or analysis on every cell in a spreadsheet. Further, proficient users in Excel will often use pivot tables to gather summary statistics.

Python— In Python, specifically in the Pandas package, viewing all data points would be a vastly inefficient use of time. Data scientist’s conduct exploratory analysis to gather summary statistics of the data they are viewing, and isolate for very specific key features. I’ve found that understanding the general “gist” of a data frame in Python came much easier to me after reviewing large Excel tabs.

2) Both Excel and Python require paying close attention to every single detail, without exception, to how information is manipulated/formulated

Excel — When taking a step back in Excel, you can see that Excel is really just coding. Your Excel entries and formulas may not be written in a designated coding language, but the idea of input arguments and output result is the same. With this idea, writing or interpreting formulas in Excel can be very tedious, as you cannot afford to have any syntax errors in your input. Although the code in your Excel formula bar may not be as extensive as some Python code, in order to have an accurate Excel spreadsheet, it is necessary to pay close attention to how each cell is calculated.

Python — Python formulas work the same way, and in fact, some Python formulas have very similar syntax to Excel formulas (“If Else” conditionals, “sum” and “mean” operators, etc). Also similarly, Python gives an error message if syntax is entered incorrectly (just as Excel gives different error types or even suggestions). I’ve found that scanning through my Python code to find errors/bugs or inconsistencies was a familiar process after scanning through the Excel formula bar in multiple cells. Mathematical formulas, and the syntax language you input, have no room for error. You must be meticulous when using both applications.

3) Both Excel and Python require communication and visualization of information

Excel — Excel is not just plain text in each cell. It is no accident that Excel is equipped with text formatting tools, color coordination, hundreds of graphs and charts, pivot tables, etc. These features exist because users very commonly must organize their data and then present their findings to others. Presenting can be as simple as color coordinating final results or as complex as creating multiple 3-dimensional surface plots.

Python — Python is not as user friendly graphically, and it does not contain some simple formatting features that Excel contains, but Python packages (such as Matplotlib and Seaborn) contain very complex visuals for showcasing your data findings. Nearly all of the graphs and charts available in Excel can be made in these Python packages. Perhaps the most crucial skill when presenting visuals in both Excel and Python is analyzing what visuals are appropiate for what audiences. There is no single right answer in deciding how to communicate and visualize your data, but rather a judgement call that must be made. I’ve found that this judgement call was familiar to me after working in Excel, in which I communicated my findings and financial data to my managers and my clients.

Conclusion

If you have used Excel and are intimidated by the idea of learning Python, you should not be. Although you will have to study hard to learn the specific Python syntax, other ancillary skills (as mentioned above) will come more naturally if you are familiar with Excel. Python and Excel, at their cores, have very similar functionalities. Looking back on my accounting position at EY, I can already think of tasks in which I could have used Python instead of Excel. Take the leap of faith, add Python to your toolkit, and I promise you won’t regret it!

Image Sources: https://www.knowledgehut.com/blog/programming/how-to-work-with-excel-using-python, https://www.datacamp.com/community/tutorials/python-excel-tutorial

--

--