Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Hells
 
Posts: n/a
Default 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   Report Post  
Gary''s Student
 
Posts: n/a
Default

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   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

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" wrote in message
...
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
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
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 09:02 PM
How do I align numbers where one number has a dollar sign? Carter Devereaux Charts and Charting in Excel 1 June 26th 05 07:20 PM
How to compare 3 numbers and return value basic Excel Worksheet Functions 6 April 8th 05 05:15 AM
finding the second largest number in a list bobf Excel Discussion (Misc queries) 1 February 16th 05 01:19 PM
Lookup closest number in list Jeff Excel Discussion (Misc queries) 6 November 26th 04 07:27 PM


All times are GMT +1. The time now is 06:11 AM.

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

About Us

"It's about Microsoft Excel"