Category Archives: Excel

Cleaning Up Coffee Production Data Using Power Query

I recently volunteered to do some pro-bono data analysis and front-end web development for a very nice Kenyan woman who is trying to provide a US distribution channel for some coffee growers in her native Kenya. This post documents my work on tidying her coffee data. Continue reading

Posted in Excel | Leave a comment

Converting a Binary Table To Hex With Power Query

I was recently given a specification for a Digital-to-Analog Converter (DAC) that contains a table of register settings that correspond to the DAC's output voltage. Each row of the table corresponds to one register setting and each column corresponds to a register bit. Thus, each table cell corresponds to a single bit – a 1 or 0. A simplified version of this table is shown in Figure 1 – a simplified version of the much larger table I was working with. Continue reading

Posted in Excel | 2 Comments

Another Excel TEXTJOIN Example

I have been analyzing seemingly random fuse failures in different products. The failing fuse is similar to the unit shown in Figure 1. My analysis has shown that the fuses are failing because of damage they are sustaining during the manufacturing process. In my analysis report, I was asked to list each product that experienced a fuse failure and to list how many days each product was in service before the fuse failure occurred. Continue reading

Posted in Excel | 1 Comment

Using Excel to Convert a Number List to Dashed String of Ranges

While working on a test report for an aircraft manufacturer this week, I needed to convert a large number of number lists to strings of dashed ranges. For example, suppose you are given a list {1, 2, 3, 5, 6, 7, 8, 10}. Converting this list to a dashed set of ranges means generating the string "1-3, 5, 6-8, 10." Figure 1 shows another example with an optional prefix added to each number. Continue reading

Posted in Excel | 1 Comment

Let's Grow Some Oats

I am going to grow and process some oats this year. This is a project that I have been interested in doing for a while because one of my sons is now in the oat business and he has shown some interest in working through the entire oat processing cycle. As a boy, I used to mill oats on the family farm, but I remember very little of that time. Continue reading

Posted in Excel, General Mathematics | Leave a comment

Age of Supreme Court Justices at Confirmation with Power Query

I was listening to a political pundit mention that both US political parties want to confirm young Supreme Court justices to ensure that their judicial philosophies endure. I was curious as to whether that was true over time. I went to the Wikipedia and saw that they had a list of all the justices since the founding of the US and web pages for each justice. Sounds like a perfect opportunity for a bit of web scraping! Continue reading

Posted in Civics Through Spreadsheets, Excel, History Through Spreadsheets | Leave a comment

Power Query DATEDIF Function

I have been using Excel's DATEDIF function for years to determine the age of items in years, months, and days. I did not know that the function was unsupported and had issues until I ran into a bug last week. Because much of my personal work involves dates, I need to have an accurate age calculation function for use in Excel and Power Query. In this post, I will discuss a DATEIF workaround that I found online (Figure 1) and a Power Query age calculation function that I wrote based on a concept from Imke Feldmann. My workbook is available here for those who are interested. The workbook shows how I tested the routine by comparing it with the DATEDIF workaround results. I tested the boundary conditions and then random dates. The results agreed with the DATEDIF workaround of Figure 1 and an online date calculator. Continue reading

Posted in Excel | Leave a comment

Computing the Longest Lived US President with Power Query

I was listening to news the other night when I heard a reporter mention that Jimmy Carter just became the oldest US president in history. I thought verifying this fact would be a good Power Query exercise. He had just surpassed George H.W. Bush, the previous record holder. Continue reading

Posted in Excel, History Through Spreadsheets | Leave a comment

Good Use for Excel Textjoin Command

One common Excel task is tracking work hours. As a contractor, I encounter all sorts of approaches to recording work hours. One small company wants all of my hours captured in an Excel workbook that contains one worksheet per week. Every two weeks, an administrator goes in and captures the hours into another worksheet. Continue reading

Posted in Excel, Uncategorized | Leave a comment

US Submarine Production During WW2

One WW2 topic that continues to intrigue me was how US war planners kept the Imperial Japanese Navy (IJN) at bay long enough to build a large naval force. The key was the use of submarines for commerce raiding to disrupt the war material supply chain and tie down Japanese surface forces with convoy defense duty. This post will use Power Query to scrape the Wikipedia for this data. The Wikipedia is becoming a wonderful source for WW2 information. Continue reading

Posted in Excel, History Through Spreadsheets, Naval History | 1 Comment