My 3 Favorite Ways to Use Data in Excel Tables
Three practical functions for Excel data extraction and summary
Suppose you have a large workbook with beautifully formatted, filtered and sorted tables. You might think the work is done, but in reality, Excel is waiting for you to do more on these tables, eager to help you make the most of the hard work you have done so far.
This article will introduce three functions or combinations of functions that I often use that can be used to extract or summarize information in Excel tables.
VLOOKUP and HLOOKUP
VLOOKUP and HLOOKUP are both used to find and retrieve values at specific locations in a table.
- VLOOKUP relies on a vertical data table and looks up the first column (vertical) in the table.
- HLOOKUP relies on the horizontal data table and looks up the first row (horizontal) in the table.
VLOOKUP
Here, I have a list of test scores and the required grades for each grade (we call it Table 1). I also have a table with student grades (called Table 2 from this point). I want Excel to use the information in Table 1 to complete the missing columns in Table 2.
I will use VLOOKUP because I want Excel to look up the values in the first column of Table 1 to return the grades of each student in Table 2. The syntax of the VLOOKUP function is as follows:
<code>=VLOOKUP(a,b,c,d)</code>
Of:
- a is the value to be looked for (in the above example, that is the value in column E),
- b is a table containing the reference values (in this case, it is cells A1 to B9, or Table 1),
- c is the column number in that table (I want it to return the level, so it is the second column in Table 1), and
- d is an optional condition that tells Excel whether to approximate lookup values ("TRUE") or exact lookup values ("FALSE"). If left blank, the default value is TRUE.
So, in my case, I would enter this formula in cell F2 to calculate the grades of Tom and then use autofill to find other grades in the table:
<code>=VLOOKUP(E2,$A:$B,2,TRUE)</code>
I used the $ symbol to create an absolute reference for the above value b because I want Excel to continuously use cells A1 to B9 to find the value. I also used "TRUE" for the value d because the score boundary table contains ranges, not the rank assigned to a single score.
HLOOKUP
Here, we have the same level boundary information, but this time it is displayed horizontally. This means that the data we want to fetch is located in the second row of the boundary table.
The syntax of the HLOOKUP function is similar to that of VLOOKUP:
<code>=HLOOKUP(a,b,c,d)</code>
Of:
- a is the value to be found (in this example, the value in column C),
- b is an absolute reference to the cell containing the search value (in this case, it is A1 to I2),
- c is the row number in the table (I want it to return the level, so it is the second row), and
- d (optional) is "TRUE" (approximate value) or "FALSE" (exact value).
So I will enter this formula in cell C5 to calculate the grades of Tom and then use autofill to find other grades in the table:
<code>=VLOOKUP(a,b,c,d)</code>
INDEX and MATCH
Another effective way to find and retrieve values is through INDEX and MATCH, especially when used together. INDEX looks for and returns the value of the defined position, while MATCH looks for and returns the bit of the value. Together, they can implement dynamic data retrieval.
Single grammar
Before we look at these functions together, let's briefly view them individually.
The syntax of INDEX is
<code>=VLOOKUP(E2,$A:$B,2,TRUE)</code>
where a is the range of cells containing data, b is the row number to be evaluated, and c is the column number to be evaluated.
Based on this,
<code>=HLOOKUP(a,b,c,d)</code>
will evaluate cells B2 to D8 and return the values in the fourth row and second column in that range.
For MATCH, we follow
<code>=HLOOKUP(B5,$A:$I,2,TRUE)</code>
where x is the value we are looking for, y is the range of values we are looking for, and z (optional) is the matching type.
Based on this,
<code>INDEX(a,b,c)</code>
will tell me where the number 5 is in range B2 to B8, while 0 tells Excel to perform an exact match.
Use in combination
In this example, I want Excel to tell me the number of goals a specified player scores in a given month. More specifically, I want to know how many goals a player C scored in the third month, but I will create this formula so that I can change those conditions at any time.
To do this, I need Excel to determine the position of player C in the table and then tell me the value in the third column of the data.
In cell G4, I will start with the INDEX function because I want Excel to look up from my original data and return a value. I will then tell Excel where to look for that data.
<code>INDEX(B2:D8,4,2)</code>
The next part of the INDEX syntax is the line number, which will vary depending on the player I declare in cell G2. For example, if I want to find player A, it will be the first row. To do this, I'll start the MATCH function because I want Excel to match the player in cell G2 to the corresponding cell in player column (A2:A8) and figure out which row it is located. I also added the last 0 because I want Excel to return exact retrieval.
<code>=VLOOKUP(a,b,c,d)</code>
Now that I have told the Excel INDEX function line number, I need to do it with the column number. In my example, the column number represents the month number I typed in cell G3.
<code>=VLOOKUP(E2,$A:$B,2,TRUE)</code>
When I pressed the Enter key, Excel correctly told me that Player C had scored five goals in the third month.
Now I can change any value in my lookup table to find the total of any player in any month.
COUNTIF and SUMIF
As you can see from their names, these two functions count and sum values based on the conditions you set. Anything not included in your condition will not be added or counted, even if it is within the scope you specified.
COUNTIF
COUNTIF counts cells containing specific conditions. The syntax is
<code>=HLOOKUP(a,b,c,d)</code>
where a is the range you want to count, and b is the condition for counting.
Similarly, if I want to include multiple conditions, I will use COUNTIFS:
<code>=HLOOKUP(B5,$A:$I,2,TRUE)</code>
where a and b are the first range condition pairing, and c and d are the second range condition pairing ( You can have up to 127 pairs).
If any condition is a text or logical or mathematical symbol, it must be enclosed in double quotes.
In my salary table below, I want to calculate the number of people earning over £40,000 and the number of people who receive over £1,000 bonuses separately.
To calculate the number of employees who have a salary of more than £40,000, I need to enter this formula in cell D8:
<code>INDEX(a,b,c)</code>
where C2:C6 is the range of salary, ">40000" is the condition.
To calculate the number of service staff who receive over £1,000 bonus, I will use COUNTIFS because I have two conditions.
<code>INDEX(B2:D8,4,2)</code>
B2:B6,"Services" Part is the first range conditional pairing, D2:D6,">1000" is the second one.
Even if I separate thousands digits with commas in my table above, I don't include these commas in the formula, because commas have different functions here.
SUMIF
SUMIF sums cells according to the conditions you set. It works similarly to COUNTIF, but contains more parameters in parentheses. The syntax is
<code>MATCH(x,y,z)</code>
where a is the range of cells you want to evaluate before requesting, b is the condition for that evaluation (this can be a value or a cell reference), c (optional) is the cell to be added if it is different from a.
This time, we have to calculate three things: the total salary for more than £40,000, the total salary for the service department and the total bonus for employees who have more than £35,000.
First, to calculate the total salary of more than £40,000, I need to enter the following formula in cell D8:
<code>=VLOOKUP(a,b,c,d)</code>
where C2:C6 quotes the salary in the table, ">40000" tells Excel to sum only values exceeding this amount.
Next, I want to find out the total salary of the service department. So, in cell C9, I will type
<code>=VLOOKUP(E2,$A:$B,2,TRUE)</code>
where B2:B6 quotes department columns, "Services" Tell Excel I'm looking for employees in the service department, C2:C6 Tell Excel about these Employees' wages are summed.
My last task was to find out how much bonus the employees earning over £35,000 received. In cell C10, I will type
<code>=HLOOKUP(a,b,c,d)</code>
where C2:C6 tells Excel to evaluate wages, ">35000" are the conditions for these wages, D2:D6 Tell Excel to meet the conditions Personal bonus sum.
Excel also has the SUMIFS function, which performs the same procedure, but for multiple conditions. It is very different from SUMIF's syntax:
<code>=HLOOKUP(B5,$A:$I,2,TRUE)</code>
where a is the range of cells to be added, b is the first range to be evaluated, c is b, d and e are the next range condition pairing (you can have up to 127 pairs).
Using the table above, let's say I want to sum the bonuses for employees who earn more than £45,000. Here is the formula I will enter:
<code>INDEX(a,b,c)</code>
After mastering the above functions, try using the XLOOKUP function, which is designed to solve some of the disadvantages of VLOOKUP by finding the values on the left and right of the Find Value column without rearranging the data.
The above is the detailed content of My 3 Favorite Ways to Use Data in Excel Tables. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Quick link Why should tables be named in Excel How to name a table in Excel Excel table naming rules and techniques By default, tables in Excel are named Table1, Table2, Table3, and so on. However, you don't have to stick to these tags. In fact, it would be better if you don't! In this quick guide, I will explain why you should always rename tables in Excel and show you how to do this. Why should tables be named in Excel While it may take some time to develop the habit of naming tables in Excel (if you don't usually do this), the following reasons illustrate today

This tutorial shows you how to quickly apply, modify, and remove Excel table styles while preserving all table functionalities. Want to make your Excel tables look exactly how you want? Read on! After creating an Excel table, the first step is usual

This tutorial explains how to use MATCH function in Excel with formula examples. It also shows how to improve your lookup formulas by a making dynamic formula with VLOOKUP and MATCH. In Microsoft Excel, there are many different lookup/ref

The tutorial shows how to compare text strings in Excel for case-insensitive and exact match. You will learn a number of formulas to compare two cells by their values, string length, or the number of occurrences of a specific character, a

Improve the accessibility of Excel tables: A practical guide When creating a Microsoft Excel workbook, be sure to take the necessary steps to make sure everyone has access to it, especially if you plan to share the workbook with others. This guide will share some practical tips to help you achieve this. Use a descriptive worksheet name One way to improve accessibility of Excel workbooks is to change the name of the worksheet. By default, Excel worksheets are named Sheet1, Sheet2, Sheet3, etc. This non-descriptive numbering system will continue when you click " " to add a new worksheet. There are multiple benefits to changing the worksheet name to make it more accurate to describe the worksheet content: carry

A must-have for Excel experts: the wonderful use of the F4 key, a secret weapon to improve efficiency! This article will reveal the powerful functions of the F4 key in Microsoft Excel under Windows system, helping you quickly master this shortcut key to improve productivity. 1. Switching formula reference type Reference types in Excel include relative references, absolute references, and mixed references. The F4 keys can be conveniently switched between these types, especially when creating formulas. Suppose you need to calculate the price of seven products and add a 20% tax. In cell E2, you may enter the following formula: =SUM(D2 (D2*A2)) After pressing Enter, the price containing 20% tax can be calculated. But,

Quick Links The AGGREGATE Syntax

Improve Excel’s productivity: A guide to efficient naming worksheets This article will guide you on how to effectively name Excel worksheets, improve productivity and enhance accessibility. Clear worksheet names significantly improve navigation, organization, and cross-table references. Why rename Excel worksheets? Using the default "Sheet1", "Sheet2" and other names is inefficient, especially in files containing multiple worksheets. Clearer names like “Dashboard,” “Sales,” and “Forecasts,” give you and others a clear picture of the workbook content and quickly find the worksheets you need. Use descriptive names (such as "Dashboard", "Sales", "Forecast")
