+ Reply to Thread
Results 1 to 5 of 5

How can I use numbers to define range for Max() ?

  1. #1
    Registered User
    Join Date
    02-27-2006
    Posts
    4

    How can I use numbers to define range for Max() ?

    I know the absolute offsets of the rows and columns in a seperate sheet and want to get the max of that range. For example:
    =Max(CC, RR, cc, rr)

    where all the parameters are numbers allowing me to define the range.

  2. #2
    Gary''s Student
    Guest

    RE: How can I use numbers to define range for Max() ?

    Try:


    Function mxinr(c1 As Long, r1 As Long, c2 As Long, r2 As Long) As Double
    Dim r, rr As Range
    Dim v As Double
    Set r = Range(Cells(r1, c1), Cells(r2, c2))
    v = Cells(r1, c1).Value
    For Each rr In r
    If rr.Value > v Then
    v = rr.Value
    End If
    Next
    mxinr = v
    End Function

    --
    Gary''s Student


    "excel12345" wrote:

    >
    > I know the absolute offsets of the rows and columns in a seperate sheet
    > and want to get the max of that range. For example:
    > =Max(CC, RR, cc, rr)
    >
    > where all the parameters are numbers allowing me to define the range.
    >
    >
    > --
    > excel12345
    > ------------------------------------------------------------------------
    > excel12345's Profile: http://www.excelforum.com/member.php...o&userid=31975
    > View this thread: http://www.excelforum.com/showthread...hreadid=517016
    >
    >


  3. #3
    JE McGimpsey
    Guest

    Re: How can I use numbers to define range for Max() ?

    Check out the OFFSET() function in XL Help.


    In article <[email protected]>,
    excel12345 <[email protected]>
    wrote:

    > I know the absolute offsets of the rows and columns in a seperate sheet
    > and want to get the max of that range. For example:
    > =Max(CC, RR, cc, rr)
    >
    > where all the parameters are numbers allowing me to define the range.


  4. #4
    Ardus Petus
    Guest

    Re: How can I use numbers to define range for Max() ?

    =MAX(INDIRECT("Sheet2!"&ADDRESS(rrf,ccf)&"":""&ADDRESS(rrl,ccl)))

    HTH
    --
    AP

    "excel12345" <[email protected]> a
    écrit dans le message de
    news:[email protected]...
    >
    > I know the absolute offsets of the rows and columns in a seperate sheet
    > and want to get the max of that range. For example:
    > =Max(CC, RR, cc, rr)
    >
    > where all the parameters are numbers allowing me to define the range.
    >
    >
    > --
    > excel12345
    > ------------------------------------------------------------------------
    > excel12345's Profile:

    http://www.excelforum.com/member.php...o&userid=31975
    > View this thread: http://www.excelforum.com/showthread...hreadid=517016
    >




  5. #5
    Registered User
    Join Date
    02-27-2006
    Posts
    4
    Thanks to all of you for your help - I actually used a bit from each of you and solved the problem and learned some valuable information at the same time. Your time and effort in helping me is much appreciated.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1