Getting to know the data table and basic functions
Freeze panes, filter and sort – then the first eight functions every engineer must know, from counting to SUMPRODUCT.
Tip: Space plays and pauses, arrows skip back and forward. Choose the narration and subtitle language with the settings button in the player.
Full video transcript
Intro Hi everyone, and welcome to the Excel for Industry course. The course was built especially for industrial and management engineering students and engineers, and its goal is simple: that you walk into interviews, Excel tests, and your first job feeling confident. We will start from the basics, with simple functions like SUM, and also IF, and move step by step to charts, PivotTables, and Gantt charts. In this lesson we will work on a real data table, exported from a company ERP system. We will learn to understand the data, arrange it in a convenient way, and use a few basic functions. And at the end, I will show you one function that will save you a lot of work. Let us begin.
Meeting the table When you get a new data table, the first step is to understand what is in it, before you touch anything. This is an inventory report of a retail company that sells tools. The first column holds the SKU. It is the unique key of the table: every item has exactly one SKU. After it come the item name, the unit cost, and the selling price. Notice that some of the headers are cut off, because the columns are too narrow.
Column width To widen a column to fit its content, point at the line between two column headers, and double-click. You can also select several columns together, and double-click one of the lines. That way they all adjust at once.
The other columns Now we can read all the headers. After the prices come the weight, the volume, and the supplier name. Then there are three consumption columns: year zero is the current year, year one is last year, and year two is two years ago. The On Hand Inventory column shows the stock that is in the warehouse right now, and the Open Purchase Order column shows the quantities we ordered from suppliers that have not arrived yet.
Selecting the header row Before we start analyzing, it is worth formatting the header row, so it stands out. To select all the headers, click cell A1, and press Control, Shift, and the right arrow. Excel selects up to the last column that has data, and stops there.
Color and border Now color the row with a strong background color, using the Fill Color button on the Home tab. Then add a border, using the Borders button, to separate the headers from the data.
Freezing the top row When you scroll down, the headers disappear, and it is hard to remember which column is the selling price, and which is the unit cost. So we freeze the first row: on the View tab choose Freeze Panes, and then Freeze Top Row. Now, even when you scroll to the end of the table, the headers stay in view.
Checking for duplicates Now that we understand the table, let us check that the data is valid. The first check is that there are no duplicate SKUs, because each SKU should appear only once. Select the SKU column, and on the Home tab choose Conditional Formatting. From there choose Highlight Cells Rules, and then Duplicate Values. If there is a duplicate value, Excel will color it red.
Filtering by color Now add a filter to the table, using the Data tab and the Filter button. A small arrow appears at the top of each column. To test the formatting, I will copy an existing SKU, and paste it in another row. Right away, both cells turn red. From the arrow of the SKU column, choose Filter by Color, and the red color, and you see only the duplicate values. At the end, we put back the original value.
Sorting and filtering by supplier The filter also lets you sort the data. From the arrow at the top of the column, choose sort smallest to largest, and the cheapest item moves to the top of the table. With sort largest to smallest, we see the most expensive item. Later in the lesson we will see how to find these values with functions too. You can also filter by supplier: in the supplier column choose, for example, Horizon Building Products, click OK, and you see only the items we buy from them.
Adding rows The data looks valid, so we can start working with the numbers. To make room for calculations above the table, we add two empty rows: select rows one and two, right-click, and choose Insert. Now the headers are in row three, and above them we have room for calculations.
COUNTA The first question is, how many items are in the report. You can select a column and look at the status bar at the bottom of the screen. But it is better to use a function. The COUNTA function counts every cell that is not empty, whether it holds numbers or text. Type equals, COUNTA, and open the parenthesis. Excel shows under the cell the arguments the function expects. I recommend that you open the file and practice along with me. Now click cell A4, press Control, Shift, and the down arrow, to select to the end of the column, and press Enter. The result is one thousand. We have one thousand items in the report.
COUNT The COUNT function, without the letter A, counts only cells that hold numbers. If we use it on a text column, we get zero. But on the unit cost column, which is all numbers, we also get one thousand. It is important to remember the difference: COUNTA counts every cell that is not empty, while COUNT counts only numbers.
MAX and MIN Now let us move to three basic math functions: maximum, minimum, and average. The MAX function returns the highest value in a range. We use it on the unit cost column, and get one hundred eighty nine dollars. That is the highest cost we pay a supplier for a single item. The MIN function returns the lowest value. On the selling price column, we get seven dollars and thirty five cents.
AVERAGE Before we calculate an average, a small tip: when you select a range, the status bar at the bottom already shows the average, the count of cells, and the sum. Now we write the function ourselves. The average function is called AVERAGE. The average of the weight column is one point eight five kilos. There are many digits after the decimal point, so on the Home tab, in the Number group, click the button that decreases decimal places.
SUM Let us move to the consumption columns. We want to know in which year the most units were consumed. That does not necessarily mean which year we earned more, but it gives a good picture of demand. Type equals, SUM, and select the whole consumption column for the current year. The result: three hundred sixty seven thousand, four hundred sixty four units.
Copying a formula Now copy the formula with Control C, and paste it with Control V, into the next two columns. Notice what happened to the range: it moved together with the formula, and now it sums the next column. That is called a relative reference. Later in the course we will learn how to lock a range, with the dollar sign. We can see that consumption was highest in the current year, then two years ago, and lowest last year. With only three numbers, it is easy to compare. But with dozens of months or days, it is better to use colors.
Color scale For that we use conditional formatting again. On the Home tab choose Conditional Formatting, and then Color Scales. When you move the mouse over the options, you see a preview. We choose a scale where the high value is green and the low value is red. And if we change a number in one of the columns, the colors update by themselves.
SUBTOTAL Now let us filter the table by supplier, for example Horizon Building Products. Notice that the totals at the top do not change. The SUM function adds up all the rows, even the ones the filter hid, and that confuses a lot of people. That is why there is the SUBTOTAL function. It can do several kinds of calculations, like sum, average, or count, and it only takes the visible rows into account. The first argument sets the type of calculation, and the number nine means sum. Type nine, comma, and select the inventory column. Without a filter, the total inventory is one hundred thirty two thousand, seven hundred eighty nine units. Now filter again by the supplier, and the result updates to one thousand five hundred fifty two. That is the inventory of this supplier only. That way the number in front of you always matches what the table shows. At the end, turn off the filter, using the Data tab and the Filter button.
A multiplication formula On to the next question: how much money are we about to pay suppliers for the open orders? First let us calculate it the long way. In each row we need to multiply the open order quantity by the unit cost. We do not have such a column, so we add a new column at the end of the table, and type: equals, L4, times C4.
Filling all the rows To copy the formula to all the rows, select the cell, and double-click the small square in its bottom corner. The formula is copied automatically to the end of the table. We call the column Sum PO Dollar. And since it is a column we added ourselves, it is common to color it differently, so we remember it holds calculations and do not overwrite them by mistake. We pick purple.
Sum and dollar format Now let us sum the new column, with the SUM function. To make it clear that this is money, select the column, and choose the dollar format on the Home tab. Remove the digits after the decimal point, and we get the result: we have open orders worth nine hundred ninety five thousand, five hundred eighty one dollars.
SUMPRODUCT To get this result, we took several steps: we added a column, wrote a multiplication formula, copied it to all the rows, and summed it. All of that can be done in one step, with the SUMPRODUCT function. Type equals, SUMPRODUCT, and select the open orders column. Then a comma, and select the unit cost column. Press Enter, and we get exactly the same amount: nine hundred ninety five thousand, five hundred eighty one dollars.
Summary and exercise So what does SUMPRODUCT do? In each row, it multiplies the values from the columns we chose, and at the end it adds up all the products. No helper columns, and no extra steps. And to finish, an exercise for you: calculate the profit for each year. The profit of an item is the consumption times the selling price, minus the consumption times the unit cost. For example, in the first row: four hundred twenty five times one hundred eighty three, minus four hundred twenty five times one hundred six. Do this for all the years, and check which year was the most profitable. In the next lesson we will solve the exercise together, and learn PivotTables, and also ways to build reports without them. Good luck, and see you in the next lesson!