Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Maximum Absolute with sign

How can I create a user function that accomplishes this:

=IF(MAX(H2:H35)<ABS(MIN(H2:H35)),MIN(H2:H35),MAX(H 2:H35))


I want this function to let me simply enter

=MAXABS(h2:h35)

Thanks in advance,

Bram Weisma

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Maximum Absolute with sign

The simplest way is to use exactly the same formula ..

Function MAXABS(rng As Range)

With WorksheetFunction
MAXABS = IIf(.Max(rng) < Abs(.Min(rng)), .Min(rng), .Max(rng))
End With

End Function

Although it's probably slightly more efficient to avoid calculating the Maximum and Minimum more than once ..

Function MAXABS(rng As Range)

Dim MaxVal, MinVal

MaxVal = WorksheetFunction.Max(rng)
MinVal = WorksheetFunction.Min(rng)

MAXABS = IIf(MaxVal < Abs(MinVal), MinVal, MaxVal)

End Function

Enjoy,
Tony

----- bramweisman wrote: -----

How can I create a user function that accomplishes this:

=IF(MAX(H2:H35)<ABS(MIN(H2:H35)),MIN(H2:H35),MAX(H 2:H35))


I want this function to let me simply enter

=MAXABS(h2:h35)

Thanks in advance,

Bram Weisman


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Maximum Absolute with sign

Tony, Well Done! Thanks a lot!

Bra

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maximum Absolute values HW Excel Worksheet Functions 3 September 23rd 08 07:37 PM
how can i change dollar sign to rupee sign in sales invoice vishal kohli Excel Discussion (Misc queries) 3 May 10th 07 02:06 PM
$ sign for absolute reference Explanation pano Excel Worksheet Functions 3 February 14th 07 03:28 PM
How do I get the maximum absolute value of a range of numbers? biscuitsmom Excel Discussion (Misc queries) 2 January 19th 06 07:55 PM
XL invoice replace the dollar sign with euro sign Pamela casares New Users to Excel 2 December 16th 05 08:21 PM


All times are GMT +1. The time now is 07:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"