The use of Pivot Tables in Excel

What is a pivot table? It is a feature in MS Excel made to help organize and condense complex-to-understand data. The pivot table is best for finding patterns appearing in the data matrix being processed and brings out trends and relationships in the data, enabling the user to present key aspects of information in a more meaningful way.

Pivot tables allow us to summarize and analyze numerical data. We can group and total data, explore details behind the totals, and create neat and visually appealing reports. They are particularly useful for comparing data, analyzing trends, and drawing insights from complex datasets, such as sales data or financial data. Pivot tables work by reorganizing and summarizing data without altering the original dataset, making data analysis more efficient and insightful.

Users can choose which data to include in the pivot table and can specify the rows, columns, and values that they want to see. This allows users to customize the pivot table to meet their specific needs and goals.

So reiterating the purpose of pivot tables: calculate, summarize, and analyze data in Excel. It helps you see comparisons, patterns, and trends within your dataset. Hence the keywords #Organize and #Summarize.

Let’s assume, for demonstration’s sake, that we have an e-commerce store with customers from some major countries in the world. Our website gathers the data in a spreadsheet in downloadable form. In the scenario, we have order id, customer names, products category, purchased products, product price, quantity, order date, country and city columns in the downloaded file. To get useful insights, we start with a sizable dataset (typically tabular) and build a pivot table.

We can either do this stuff by manually putting in formulas and functions, or use pivot tables and let excel do the heavy lifting. Here, Pivot Tables come in handy and allow us to: Group data by different criteria (e.g., sales by region, products by category); Summarize values (e.g., total sales, average scores); filter, sort, and rearrange data dynamically.

Sample Data Set Snippet

The sample dataset for the pivot table exercise uploaded at the above link for convenience. In the next step, we want to analyze a few points in the information to better understand your business position. This will help us in our decision making in the future and direct the business into a more desired state.


Creating a Pivot table: Basic Steps

Select the data range (ensure it’s organized in columns with headers). Go to the Insert tab and click Pivot table. Choose where to place the Pivot table (new sheet or existing sheet). Drag fields (columns) into the Rows, Columns, and Values areas to build the summary table.

Now the next step would be to identify patterns for further decision making. Suppose we want to find out what country and city is giving us the most sales so that we can devote a CSR team to provide seamless customer service for that area.

Place the cursor on a cell of the table, go to the Insert tab and click on Recommended Pivot Tables. Excel will suggest pivot tables with different calculations for your ease. Either choose from the list or we can click the pivot table and start from scratch.

Recommended Pivot Table Snippet

As seen above, the Sum of price by country is a very simple table which can help identify which country is giving the most sales. Choosing this will open a pivot table in a new sheet for editing. Here’s what happens. Excel rearranges the country column inputs into row labels and then adds up the values in the price column and presented the results in a single cell in the Sum of price column. See below:

Table Fields snippet

Note that we have the option to calculate prices manually using other formulas, like SUMIF. However, here the Pivot table is performing the action for us. If we want to see country and city wise data, we can drag the city field into the rows and so on as per requirement.


Editing Pivot Tables

Based on the table, it might seem that the USA is giving us the most business, however to determine other aspects, we might need to know how many items are being sold in Italy to give the total price amount. For this, we can drag “Quantity” into the values field and choose SUM in functions (when selected in values area). Subsequently, we move the order id and quantity columns from the dataset to the values area, for calculating the sum of quantity and count of order.

Modified Table Snippet

Next, we adjust the prices of products in Italy (which were mistakenly put before) and recreate the pivot table. This time we see that the sum of price divided by the sum of quantity is higher for Italy than that for the USA, meaning Italy may have more potential for quality product sales.

Calculating potential sales Snippet

From the above brief example, we can infer that Excel’s pivot table function empowers users to explore, analyze, and summarize huge datasets with ease. It helps in presenting data in a user-friendly way, filtering, grouping, sorting, and conditionally formatting subsets of data, and rotating rows to columns or vice versa (pivoting) to view different summaries of the source data.

For effective pivot tables: organize data in columns (not rows), ensure all columns have headers, use clean, tabular data for best results, format your data as an Excel table, and consider using Power Query for complex data transformations.

Hope this helps!


Useful Links & References:

  1. https://blog.hubspot.com/marketing/how-to-create-pivot-table-tutorial-ht
  2. https://www.lumeer.io/pivot-table-complete-guide/
  3. Microsoft Support: Create a Pivot table
  4. Excel Easy: Pivot Tables

How do I use the Excel “VLOOKUP” function?

You are solving problems on a deadline and need a conditional search in the company database. In comes Vertical Lookup to the rescue.

The Excel developers created an indispensable formula that greatly simplifies tasks related to searching and formatting data within large datasets. Excel functions are formulas that facilitate the user’s data processing. Processed data can be useful in performing various tasks. Excel provides multiple such functions designed to aid in processing data into a desired shape. But sometimes, the crude description of the function input parameters and variables proves an obstacle to carrying out the functions.

To help in understanding the implementation flow of the function, brief manuals are found on the global web in the form of written articles or videos on platforms. In the plethora of tons of information lying around on the internet, I gift you one more snippet of how I understand the VLOOKUP function. Use Case:

Consider that you have 1,000 employees working in different organizations through your agency. You are preparing to run their payroll, but you are in doubt of the ID of the employee mobilized to the “Healthplus” organization. The employee’s name is Santosh, and he is a doctor.

Fortunately, you have access to the main recruitment file, downloaded from the HRIS software, such as Oracle Fusion Cloud, and it may be assumed that your company module does not include the search option in Oracle Cloud.

Let’s break down the components of the function:

  • The lookup value, or simply the value you want to search for,.
  • When using the VLOOKUP function, ensure that your lookup value is in the first column of the specified range. For instance, if your lookup value resides in cell C2, your range should begin with column C.
  • When using the VLOOKUP function, remember that the column number corresponds to the position of the desired value within the specified range. For instance, if your range is B2:D11, consider B as the first column, C as the second, and so forth. 
  • When using the VLOOKUP function, you have the option to specify TRUE for an approximate match or FALSE for an exact match of the return value. If you omit this specification, the default behavior is an approximate match.

=VLOOKUP (lookup value, range containing the lookup value, the column number in the range containing the return value, Approximate match (TRUE) or Exact match (FALSE))

Snapshot of VLOOKUP function application

Here is what the backend looks like. The VLOOKUP function searches for a specified value (such as “Santosh”) in the leftmost column of the table array (A1:F6). If a match is found, it returns the corresponding value from a specified column (e.g., the employee ID column # 5).In this case, if “Santosh” is found in row 1, the function would return the employee ID “EMP-0001.

Note that VLOOKUP is not case-sensitive. Similar to VLOOKUP, the HLOOKUP (horizontal lookup) function is based on the same principles horizontally. However, vertical data tables predominate in the information world, so HLOOKUP is seldom used.

To be honest, it is a great function for searching attributes of a specified value, which helps you acquire data. I hope this helped!

References:

How to use Excel “SUMIF” Function?

Almost all of the needs of a modern-day corporate entity, or a small business can be fulfilled by using Microsoft Excel software.

This is my humble opinion, though, and I may be wrong, however, it is an undeniable observation on my part, and I have gathered feedback from many professionals in the industry, that many of the financial and record keeping aspects of organizations can be maneuvered using the software.

Recently, I was asked an interview question regarding the “SUMIF” function of Excel. I politely told them about my ignorance of the function; however, it got stuck in my mind. So afterwards, I did a little research on the function to understand it and have consequently placed it below my way of understanding it.

In Excel, by specifying the list to be worked on, the filter criteria, and the field to be summarized, it is possible to use conditional =IF functions. SUMIF is one of them.

The function has three portions, range, criteria, and sum_range.

So how will it proceed? Let me explain in my own words. Mind it, this does not represent the actual machine language or work behind the function.

a) The function will go through the range provided, let’s say, from 2019 to 2024.

b) It will then check for the criteria, for example, if the criteria are the year 2020 from the above year range, it will mark that criterion.

c) Lastly, it will check the sum range for every corresponding value to the criteria value cell and bring back the sum of those corresponding cell values.

I have an image placed below for better understanding the function:

Snapshot of SUMIF function application

Here you see, checking the total sales in Lahore region is convenient in this situation, as the function has gone through the RANGE of C13 to C18, checked the CRITERIA in B22 i.e., (Lhr), and added all corresponding values of B22 in the SUM_RANGE D13 to D18, bringing back the value of 3200.

“SUMIF” handles one condition at a time, while the similar function “SUMIFS” can evaluate multiple criteria at a time.

To be honest, it is a great function for decision points, which helps you make decisions accordingly. I hope this helped!

Credit: Featured Image by our-team on Freepik