Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Max absolute value comand?? 3

Status
Not open for further replies.

SRO

Structural
Dec 27, 2001
104
Is there a comand to get the Max absolute value for a group of numbers. ie

1, 6, -14, 7 = 14
 
Replies continue below

Recommended for you

Type
Code:
=MAX(ABS(A1:A4))
and press Ctrl+Enter (enters it as an array formula). The formula now looks like:
Code:
{=MAX(ABS(A1:A4))}


Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
joerd:

Thanks, but the problem is that the values arn't in the same column or row.
 
Just separate the values with comma's:

=MAX(ABS(A1),ABS(B4),ABS(E19),....)

jproj
 
Unfortunately, you cannot use =MAX(ABS(A1,D9,F7,E12)) and select the cells holding the Ctrl key, what you would normally do. I see nothing quicker than =MAX(ABS(A1),ABS(D9),ABS(F7),ABS(E12)) unless you venture into a VBA function, which will look something like:
Code:
Function MaxAbs(ParamArray R() As Variant)
Dim C As Variant, V As Double

    V = 0
    For Each C In R
        If Abs(C.Value) > V Then V = Abs(C.Value)
    Next C
    MaxAbs = V
End Function

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Thanks for all the input, I was just hoping there would be a simple comand. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor