Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (2024)

Dataset Overview

Finding the maximum value and its corresponding cell involves identifying the highest value(s) within a dataset and determining the location of that value. In this tutorial, you’ll learn how to find the maximum value and its associated cell in an Excel spreadsheet.
Let’s take a look at the following image. It displays an employee dataset containing information such as Employee ID, Name, Joining Year, and Salary. We’ve already identified the employee with the highest salary and pinpointed the cell location for that value.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (1)

To achieve this, you can utilize Excel formulas and VBA code. Some Excel formulas will return the first maximum value along with its corresponding cell from the dataset. Other formulas can provide all the cells associated with the maximum value. Additionally, we’ll demonstrate how to determine the maximum value and its corresponding cell based on specific criteria.

Method 1 – Using an Excel Formula to Find the First Maximum Value and Corresponding Cell

By combining Excel’s INDEX and MATCH functions with other relevant functions (such as MAX, LARGE, AGGREGATE, and SUBTOTAL), you can identify the first maximum value and its corresponding cell within a single dataset.

Note: The INDEX-MATCH formula will only return the first occurrence if there are multiple maximum values.

Let’s consider the sample dataset below, which includes Employee ID, Employee Name, Joining Year, and Salary. In cells C13 and C14, we have Jack Alfred and Alisha Stokes, both earning the maximum salary of $35,000. However, the INDEX-MATCH formula will return only Jack Alfred since it appears first in the dataset.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (2)

To determine the maximum salary, apply the MAX function, use the INDEX-MATCH formula, and then find the cell reference for the maximum salary. Subsequently, you can use the CELL function to determine the cell reference for the maximum salary.

[/wpsm_titlebox]

Step 1 – Finding the Maximum Salary

To determine the maximum salary, follow these steps:

  1. In cell H5, enter the following formula:

=MAX(E6:E18)

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (3)

Note

This will display the maximum value from the range E6 to E18.

Note:You can achieve the same result using any of the following alternative formulas:

=LARGE(E6:E18,1)

=AGGREGATE(4,6,E6:E18)

=SUBTOTAL(4,E6:E18)

Remember that Alisha Stokes also has the same maximum salary of $35,000, but the formula specifically identifies Jack Alfred in this case.

Step 2 – Identifying the Employee with the Highest Salary

We want to find Jack Alfred, the employee associated with the maximum salary. In cell H8, enter the following formula:

=INDEX(B6:E18,MATCH(MAX(E6:E18),E6:E18,0),2)

This will display the name of the employee (e.g., Jack Alfred) who receives the highest salary.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (4)

Note

Note: You can also achieve the same result using these alternative formulas:

  • Formula 1:
  • Formula 2:

=INDEX(B6:E18,MATCH(AGGREGATE(4,6,E6:E18),E6:E18,0),2)

  • Formula 3:

=INDEX(B6:E18,MATCH(SUBTOTAL(4,E6:E18),E6:E18,0),2)

These alternatives will also give you the name of the employee with the highest salary.

Step 3 – Finding the Corresponding Cell Location with the Maximum Value

To determine the cell location associated with the maximum value (in this case, the highest salary), follow these steps:

  1. In cell H11, enter the following formula:

=CELL("address", INDEX(B6:E18, MATCH(MAX(E6:E18), E6:E18, 0),4))

This formula will display the cell reference, which is $E$13. The value in cell E13 represents the first maximum salary of $35000 in the Salary column.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (5)

Note

Note:You can achieve the same result using these alternative formulas:

  • Formula 1:

=CELL("address",INDEX(B6:E18,MATCH(LARGE(E6:E18,1),E6:E18,0),4))

  • Formula 2:

=CELL("address",INDEX(B6:E18,MATCH(AGGREGATE(4,6,E6:E18),E6:E18,0),4))

  • Formula 3:

=CELL("address",INDEX(B6:E18,MATCH(SUBTOTAL(4,E6:E18),E6:E18,0),4))

  • Formula 4:

=ADDRESS(MATCH(MAX(E6:E18), E6:E18, 0) + ROW(E5), 5)

  • Formula 5:

="$E$"&MATCH(MAX(E6:E18),E6:E18,0)+ROW(E5)

These alternatives will also provide you with the cell reference for the maximum salary value.

The CELL function has the following syntax: CELL(info_type,[reference]). The reference parameter is optional. If omitted, the CELL function returns the cell reference itself.

Formula Breakdown

  • Let’s break down the formula step by step:
    • MAX(E6:E18): This part of the formula calculates the maximum value within the range E6:E18. In this case, it returns 35000, which is the highest salary.
    • MATCH(35000, E6:E18, 0): The MATCH function searches for the value 35000 within the E6:E18 range. It returns the row number where this value is found. In this case, it returns 8 because the maximum salary (35000) is in the 8th row.
    • INDEX(B6:E18, 8, 2): The INDEX function retrieves the value from a specific cell within the B6:E18 range. Here, it returns the value in the 8th row and 2nd column, which corresponds to cell $E$13.

    So, the final result is that the formula points to cell $E$13, where the first maximum salary of $35000 is stored.

Method 2 – Finding Maximum Value and Corresponding Cell from Multiple Excel Ranges

The MAX function not only considers adjacent cells but also non-adjacent cells. It allows you to find the maximum value and its corresponding cell location in Excel.

  • To find the maximum value from non-adjacent cells, enter the following formula:

=MAX(E6:E12,E15:E20)

This formula will give you the highest value, which in this case is $35,000, located in cell H5.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (6)

  • Let’s find the corresponding cell for the name Jack Alfred.Enter the following formula:

=INDEX(B6:E20,MATCH(MAX(E6:E12,E15:E20),E6:E20,0),2)

This will return the value Jack Alfred located in cell H8.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (7)

  • To get the cell reference for the highest value (which is in cell E15), enter the following formula:

=CELL("address",INDEX(B6:E20,MATCH(MAX(E6:E12,E15:E20),E6:E20,0),4))

This will give you the cell reference $E$15.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (8)

Read More: How to Find Max Value in Range with Excel Formula

Method 3 – Using Excel Formulas to Find Corresponding Multiple Cells with Maximum Value

In this section, we’ll explore a method to find multiple maximum values and their corresponding cell locations by combining the TEXTJOIN-IF-MAX formula and the FILTER-MAX formula in Excel.

3.1 Combining TEXTJOIN and IF Functions

  1. Apply the MAX function to determine the maximum value from the Salary range.
  2. Use the IF function to identify the employee names who receive the maximum salary.
  3. Utilize the TEXTJOIN function to concatenate all the names with a delimiter (such as a comma).

To achieve this, follow these steps:

  • In cell H5, enter the following formula:

=TEXTJOIN(", ", TRUE, IF(E6:E18=MAX(E6:E18), C6:C18, ""))

This will give you the names Jack Alfred and Alisha Stokes.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (9)

  • To obtain the cell references E13 and E14, enter this formula:

=TEXTJOIN(", ", TRUE, IF(E6:E18=MAX(E6:E18), "E" & ROW(E6:E18), ""))

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (10)

3.2 Merging FILTER, MAX and TEXTJOIN Functions

  1. The MAX function identifies the maximum value from the Salary range.
  2. The FILTER function then filters the employee names associated with these maximum values.

Follow these steps:

  • In cell G7, enter the formula:

    =FILTER(C6:C18,E6:E18=MAX(E6:E18))

This will display the employee name with the highest salary.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (11)

  • For the corresponding cell locations of the maximum values, enter this formula in cell I7:

=TEXTJOIN(", ", TRUE, IF(E6:E18=MAX(E6:E18), "E" & ROW(C6:C18), ""))

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (12)

Method 4 – Finding Corresponding Multiple Cells with Maximum Value Based on Criteria

In this section, we’ll explore how to identify multiple maximum values and their corresponding cell references based on specific criteria. We’ll use a combination of the MAX, IF, TEXTJOIN, and TEXTSPLIT functions. Additionally, we’ll discuss how to adapt this approach for both single and multiple criteria using the IF, MAXIFS, TEXTJOIN, and TEXTSPLIT functions.

4.1 Combining MAX, IF, TEXTJOIN and TEXTSPLIT Functions for a Single Criterion

Suppose we want to find the maximum salary among employees who joined after 2018. By using the following functions, we can determine the employees with the highest salaries and their corresponding cell references based on this single criterion:

  • Start by entering the formula below in cell G9 and pressing Enter. This will provide an array of employee names:

=IFERROR(TEXTSPLIT(TEXTJOIN(",", TRUE,IF((D6:D18 > H5)*(E6:E18 = MAX(IF(D6:D18 > H5, E6:E18))), C6:C18, ""),),,","),"")

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (13)

  • Enter the following formula in cell H9 to obtain the cell location of the maximum values:

=IFERROR(CELL("address",INDEX($E$6:$E$18, MATCH(G9, $C$6:$C$18, 0),1)),"")

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (14)

  • To find the cell locations with the maximum salary, use the Fill Handle tool.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (15)

Note: Dragthe Fill Handle tool until you identify the cell location for each employee.

4.2 Joining MAX, IF, TEXTJOIN and TEXTSPLIT Functions for Multiple Criteria

Let’s assume that we want to find employees with the maximum salary who joined between 2020 and 2023. By using Excel’s MAX, IF, TEXTJOIN, and TEXTSPLIT functions, we can identify multiple employees with the highest salary and their corresponding cell references based on multiple criteria.

Follow these steps:

  • Enter the following formula in cell G10 and press Enter. This will give you the employee names in an array format:

=IFERROR(TEXTSPLIT(TEXTJOIN(",", TRUE, IF((D6:D18 >=H5)*(D6:D18 <=H6), IF(E6:E18 = MAX(IF((D6:D18 >=H5)*(D6:D18 <=H6), E6:E18)), C6:C18, ""), ""),),,","),"")

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (16)

  • Enter the following formula in cell H10 to get the corresponding cell reference for the maximum values:

=IFERROR(CELL("address",INDEX($E$6:$E$18, MATCH(G10, $C$6:$C$18, 0),1)),"")

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (17)

4.3 Merging IF, MAXIFS, TEXTJOIN and TEXTSPLIT Functions for Multiple Criteria

Similar to the previous method, we can find multiple employees with the maximum salary and their corresponding cell references based on multiple criteria. In this case, we’ll use Excel’s MAXIFS, IF, TEXTJOIN, and TEXTSPLIT functions.

Follow these steps:

  • Insert the following formula in cell G10 and press Enter. This will give you the employee names in an array format:

=IFERROR(TEXTSPLIT(TEXTJOIN(",", TRUE, IF((D6:D18 >=H5)*(D6:D18 <=H6), IF(E6:E18 =MAXIFS(E6:E18, D6:D18, ">="&H5, D6:D18, "<="&H6), C6:C18, ""), "")),,","),"")

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (18)

  • Enter the following formula in cell H10 to get the corresponding location that contains the maximum values:

=IFERROR(CELL("address",INDEX($E$6:$E$18, MATCH(G10, $C$6:$C$18, 0),1)),"")

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (19)

Read More:How to Find Maximum Value in Excel with Condition

Method 5 – Using VBA Macro to Find Multiple Maximum Values and Corresponding Cell Locations

In this section, you’ll learn how to use a VBA Macro to find the maximum value and its corresponding cell in Excel. While Excel functions and formulas can find maximum values, they don’t directly provide cell locations for those values when dealing with multiple ranges.

Let’s consider the following dataset, which contains some random numbers. The highest number, 120, appears in cells E8, E10, and C16.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (20)

Follow these steps:

  • Enter the following VBA code in a Module and click the Runcommand:
Sub Find_Multiple_Max_Values_And_Addresses_from_Range()Dim rng As RangeDim maxVal As DoubleDim results() As StringDim i As LongDim CellAddress As StringDim outputRange As RangeSet rng = Application.InputBox("Select a range:", Type:=8)ReDim results(1 To rng.Cells.Count)i = 1maxVal = Application.WorksheetFunction.Max(rng)For Each cell In rng If cell.Value = maxVal Then results(i) = cell.Address i = i + 1 End IfNext cellIf i > 1 Then ReDim Preserve results(1 To i - 1) CellAddress = Join(results, ", ") Set outputRange = Application.InputBox("Select an output location:", Type:=8) outputRange.Value = maxVal outputRange.Offset(2, 0).Value = CellAddressEnd IfEnd Sub
  • Click the Developer tab, then select Macro.
  • In the Macro dialog box, choose Find_Multiple_Max_Values_and_Addresses_from_Range and click Run.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (21)

Code Breakdown

  1. We created a sub-procedure named Find_Multiple_Max_Values_And_Addresses_from_Range.
Sub Find_Multiple_Max_Values_And_Addresses_from_Range()[Code]End Sub
  1. We prompt the user to select a range using the Application.InputBox property and assign it to the rng variable.
Dim rng As RangeSet rng = Application.InputBox("Select a range:", Type:=8)
  1. We count the cells in the rng range using Cells.Count property and initialize an array called results().
Dim results() As StringReDim results(1 To rng.Cells.Count)
  1. Calculate the maximum value within the rng range using the Application.WorksheetFunction.Max(rng) statement.
Dim maxVal As DoublemaxVal = Application.WorksheetFunction.Max(rng)
  1. We iterate through each cell in the rng range to extract cell address based on a logical statement.
For Each cell In rng[Logical Statement]Next cell
  1. We compare the value of each cell with the maximum value. If it matches, we store the cell address in the results () array.
Dim i As Longi = 1If cell.Value = maxVal Then results(i) = cell.Address i = i + 1End If
  1. If there are multiple cell addresses with the maximum value, we combine them using the Excel Join property.
Dim CellAddress As StringIf i > 1 Then ReDim Preserve results(1 To i - 1) CellAddress = Join(results, ", ")End If
  1. We prompt the user to select the output locations using the outputRange variable (which is declared as a Range).
Dim outputRange As RangeSet outputRange = Application.InputBox("Select an output location:", Type:=8)outputRange.Value = maxValoutputRange.Offset(2, 0).Value = CellAddress

To summarize the process:

  • An input dialog box appears, allowing the user to select the range $B$6:$E$18.
  • After selecting the range, the user clicks OK.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (22)

  • Another input dialog box appears, prompting the user to select the range $H$5.
  • The user selects $H$5 and clicks OK.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (23)

  • The maximum value (120) is placed in cell H6.
  • The cell locations $E$8, $E$10, and $C$16 are also recorded as having the maximum value.

Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (24)

Download Practice Workbook

You can download the practice workbook from here:

Find Max Value and Corresponding Cell.xlsm

Related Articles

  • Set a Minimum and Maximum Value in Excel
  • Excel MIN and MAX in Same Formula
  • How to Cap Percentage Values Between 0 and 100 in Excel

<< Go Back to Excel MAX Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Find Max Value and Corresponding Cell in Excel (5 Methods) - ExcelDemy (2024)
Top Articles
Rise Meadville Reviews
P-22 lived an epic and tragic life in Griffith Park. Would a new mountain lion fare any better?
Hickory Back Pages
Edutone Skyward
Meet Scores Online 2022
Monkey Werx Sitrep 2022
Log in or sign up to view
Mychart.solutionhealth.org/Mychartprd/Billing/Summary
Craigslist Shelves
Naughty Neighbor Tumblr
Inside the Rise and Fall of Toys ‘R’ Us | HISTORY
How 'The Jordan Rules' inspired template for Raiders' 'Mahomes Rules'
Black Panther Pitbull Puppy For Sale
Amazing Lash Bay Colony
Fd Photo Studio New York
Craigs List Jonesboro Ar
309 Marshall Passage
First Lady Nails Patchogue
Holly Ranch Aussie Farm
Gem City Surgeons Miami Valley South
What is a Nutmeg in Soccer? (Explained!) - Soccer Knowledge Hub
G122 Pink Pill
Amex Platinum Cardholders: Get Up to 10¢ Off Each Gallon of Gas via Walmart Plus Gas Discount
Restaurants Near Defy Trampoline Park
Fortnite Fap Hero
Amerikaanse dollar bestellen | USD kopen
Sams Gurnee Gas Price
Claw Machine Random Name Picker
Spn 102 Fmi 16 Dd15
Academy Sports Meridian Ms
St Cloud Rants And Raves
Lincoln Access Rewards Redemption
David Mayries
Nikki Porsche Girl Head
Gym Membership & Workout Classes in Lafayette IN | VASA Fitness
Mission Impossible 7 Showtimes Near Regal Willoughby Commons
Chalupp's Pizza Taos Menu
Papa Louie When Pizzas Attack Unblocked
Netdania.com Gold
N9K-C9372Px E Eol
Star News Mugshots
Bernadette Peters Nipple
Walmart Careers Com Online Application
Ihop Ralph Ave
Registrar Utd
Kathy Park Wedding
Top-Filme und Serien mit Maggie Smith
Ebony Grinding Lesbian
Uk Pharmacy Turfland
Kirstin Kresse
Varsity Competition Results 2022
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 6243

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.