+ Reply to Thread
Results 1 to 3 of 3

return largest number of a list of numbers in the same cell

  1. #1
    Hells
    Guest

    return largest number of a list of numbers in the same cell

    Hello,

    Can anyone help me, I wish to return the higest number in a string of
    numbers (all in the same cell) seperated by commas.

    Thanks

  2. #2
    Gary''s Student
    Guest

    RE: return largest number of a list of numbers in the same cell

    1. locate an un-used row of cells
    2. use Tools > Text to Columns... to separate the list into cells from step #1
    3. use the MAX() function to get the largest value.
    --
    Gary''s Student


    "Hells" wrote:

    > Hello,
    >
    > Can anyone help me, I wish to return the higest number in a string of
    > numbers (all in the same cell) seperated by commas.
    >
    > Thanks


  3. #3
    Bernie Deitrick
    Guest

    Re: return largest number of a list of numbers in the same cell

    You would need to use a User-Defined-Function - see code below.

    Used like

    =myMax(A1)

    HTH,
    Bernie
    MS Excel MVP


    Function myMax(incell As Range) As Double
    Dim myArr As Variant
    Dim myDbl() As Double
    Dim i As Integer
    myArr = Split(incell.Value, ",")
    ReDim myDbl(LBound(myArr) To UBound(myArr))
    For i = LBound(myArr) To UBound(myArr)
    myDbl(i) = CDbl(myArr(i))
    Next i
    myMax = Application.Max(myDbl)
    End Function


    "Hells" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > Can anyone help me, I wish to return the higest number in a string of
    > numbers (all in the same cell) seperated by commas.
    >
    > Thanks




+ 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