How to Get the Maximum or Minimum Absolute Value in Excel

It is easy to find the maximum or minimum value in a batch of data in excel, but if this batch of numbers contains both positive and negative numbers, the maximum or minimum absolute value cannot be found out by basic MAX or MIN function in excel. This article will help you to solve this issue by using ABS function.

Prepare a table of numbers contains both positive and negative numbers:

Get the Maximum or Minimum Absolute Value 1

As we all know, compare the absolute values for positive number and negative number, actually we compare the values without negative sign, so|-11| is larger than |10|. How can we find out the maximum or minimum value among the positive and negative numbers? Please follow below steps.

Get the Maximum or Minimum Absolute Value in Excel


Step 1: Select a blank cell, enter the formula =MAX(ABS(A1:C4)).

Get the Maximum or Minimum Absolute Value 2

Step 2: Press Ctrl + Shift + Enter together, then the MAX absolute value is displayed.

Get the Maximum or Minimum Absolute Value 3

Step 3: Use the similar formula to get the MIN absolute value. Enter the formula =MIN(ABS(A1:C4)).

Get the Maximum or Minimum Absolute Value 4

Step 4: Press Ctrl + Shift + Enter together, then the MIN absolute value is displayed.

Get the Maximum or Minimum Absolute Value 5

Get the Maximum or Minimum Absolute Value by User Defined Function


We can also define a function like MINABS or MINABS then we can directly use it to find out the MAX or MIN absolute value. See steps below.

Step 1: Click Developer tab->Visual Basic or Alt+F11 to load Microsoft Visual Basic for Applications window.

Step 2: Click Insert->Module to insert a module.

Get the Maximum or Minimum Absolute Value 6

Step 3: Enter below code in Module window.

Get the Maximum or Minimum Absolute Value 7

Function GETMAXABS(SelectRng As Range) As Double
    myarray = SelectRng.Value
    For i = 1 To UBound(myarray, 1)
        For j = 1 To UBound(myarray, 2)
            myarray(i, j) = VBA.Abs(myarray(i, j))
        Next
    Next
    GETMAXABS = Application.WorksheetFunction.Max(myarray)
End Function

Please see screenshot below:

Notes:

  1. We define the function GETMAXABS to get the maximum absolute value in excel.
  2. We can use the similar code to define another function GETMINABS to get the minimum absolute value as well. Just replace ‘max’ to ‘min’ in above code.

Step 4: Now we can try the user defined function GETMAXABS. After entering =get, we can find that defined function GETMAXABS is loaded properly.

Get the Maximum or Minimum Absolute Value 8

Step 5: Enter =GETMAXABS(A1:C4).

Get the Maximum or Minimum Absolute Value 9

Step 6: This time click Enter. Verify that MAX absolute value is displayed.

Get the Maximum or Minimum Absolute Value 10

Related Functions


  • Excel ABS Function
    The Excel ABS function returns the absolute value of a number.The ABS function is a build-in function in Microsoft Excel and it is categorized as a Math and Trigonometry Function.The syntax of the ABS function is as below:=ABS (number)…
  • Excel MIN function
    The Excel MIN function returns the smallest numeric value from the numbers that you provided. Or returns the smallest value in the array.The MIN function is a build-in function in Microsoft Excel and it is categorized as a Statistical Function.The syntax of the MIN function is as below:= MIN(num1,[num2,…numn])….
  • Excel MAX function
    The Excel MAX function returns the largest numeric value from the numbers that you provided. Or returns the largest value in the array.= MAX(num1,[num2,…numn])…
Related Posts

How to Extract First Letter from Each Word in a Cell in Excel

This post will guide you how to extract first letter from each word in a given cell in Excel. How do I extract the first letter of each word in a range of names in your current worksheet in Microsoft ...

How to ignore Blank Cells while Concatenating cells in Excel

This post will guide you how to concatenate cells but ignore all blank cells in your worksheet in Excel. How do I concatenate cells but ignore blank cells with a formula in Excel. How to create a concatenate formula to ...

How to Calculate the Average Excluding the Smallest & Highest Numbers in Excel

Calculating the average for a batch of data is frequently used in our daily life. But for some cases like statistic the average score in a competition, or price analysis, we often calculate the average excluding the smallest and highest ...

How to Count Only Numbers in Bold in a Range of Cells in Excel

This post will guide you how to Count only numbers with bold style in a range of cells in Excel. How do I Count on cells with bold font within a range of cells using User defined function in Excel ...

How to Sum Only Numbers in Bold in a Range of Cells in Excel

This post will guide you how to sum only numbers with bold style in a range of cells in Excel. How do I sum on cells with bold font within a range of cells using User defined function in Excel ...

Sidebar