Isn’t MAX a function that finds the maximum value? When did you become the “dark horse in the query world”? Did VLOOKUP even feel defeated? The following article will give you an in-depth understanding of MAX's query function. I hope it will be helpful to you!
Everyone knows that VLOOKUP can match the data we need according to the given content. Because of this, it has a great reputation in the function community. But for the three examples I want to share today, if you use VLOOKUP to match the data, it will be a bit troublesome (interested friends can try it yourself). Just when VLOOKUP was having a headache, the MAX function solved all three problems with just one routine without saying a word.
Some friends may be curious, isn't MAX a function that finds the maximum value? How can it solve the problem that VLOOKUP can't solve? And what is this routine? Let’s take a look below to understand...
Example 1: Find the latest business date of each dealer in the business details
In order to facilitate understanding of the problem, the data source only retains two columns of data: dealer and business date. Now we need to get the date of the latest business for each dealer. (Tip: The business dates in the data source are arranged in ascending order.)
I don’t know how to use VLOOKUP to solve the problem? The routine used by MAX is as follows:
=MAX(($A$2:$A$18=D2)*$B$2:$B$18)
Please see the animation demonstration for the input method :
Note that after entering this formula, you must hold down the Ctrl and Shift keys at the same time and press Enter. Braces will automatically appear in the formula.
How to understand this formula is the question that everyone is most concerned about. In fact, the principle is very simple. First, make a comparison to see which data in column A is consistent with the supplier we need to judge, that is, $A$2: $A$18=$D2 is the function of this part. Select this part of the formula in the edit bar and press the F9 key to see the calculation results of the formula.
You can see that the result of the formula is a set of logical values. When the content of column A is consistent with the dealer to be matched, TRUE is obtained, otherwise FALSE is obtained.
The next step is to use this set of logical values to multiply the business dates in column B (dates in Excel are essentially numbers). TRUE is the same as the number 1 when performing operations, and FALSE is performing operations. is the same as the number 0, so the calculation is like this.
In the obtained set of numbers, 0 indicates the value returned when the corresponding dealer is not matched, and the numbers other than 0 indicate that the corresponding dealer is matched. The business date to be returned after business consultation. The largest value is the latest date, so MAX can easily get the final result.
If the result you produce is not a date but a number, it will be no problem to change the cell format to date format.
Example 2: Get the corresponding bonus according to the job number or name
Usually when performing data matching, a fixed condition is used Find. And in this example, our condition is one of the two.
Regardless of the job number or name, you can get the corresponding bonus.
I don’t know how VLOOKUP can solve this problem? Anyway, MAX is still the same routine:
=MAX(($A$2:$B$13=E2)*$C$2:$C$13)
The formula entry method and principle will not be described in detail. It is exactly the same as Example 1. Let’s take a look at Example 3.
Example 3: Find the corresponding group code according to the name
Each group has four members, find the group it belongs to according to the name of the group member code.
If VLOOKUP still wants to struggle with the first two examples, this example can directly make VLOOKUP unable to find its way. MAX still follows the old routine:
=MAX(($B$2:$E$4=A7)*$A$2:$A$4)
2. Note that the selection of the area for judging conditions and the area where the result is located must be accurate and locked.
Then the question comes, what if the result you want to find is not a number?
At this time, MAX alone cannot cope with it. IF or other functions are needed to meet the needs. We will introduce cases in this regard later.
Related learning recommendations: excel tutorial
The above is the detailed content of Excel function learning: the dark horse in the query world - MAX()!. For more information, please follow other related articles on the PHP Chinese website!

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

This tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo

This tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi

This Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The

Unlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.