Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 24 Nov, 20:18, joeu2004 wrote:
On Nov 24, wrote: as stated in the object, I need to find the maximum in an array of strings, using VBA in Excel 2000. Of course I could use a (slooow) linear search [....] I tried to use LOOKUP, but it doesn't work, since it expects the array to be in ascending order, which of cours isn't the case, otherwise I wouldn't need to LOOKUP at all (I'd just pick the first element of the array). I interpret that to mean that the array is not ordered at all, even in descending order. In that case, you must use a linear search to find the max or min of anything. VLOOKUP and HLOOKUP can do linear searches, as can MATCH. *Whether or not they are faster than a VBA implementation, I cannot say with impunity. It might depend, in part, on what you want to find the max of. *String comparisons? *Longest string? *Something else? Hi, you're perfectly right, the array is not ordered in any sense. My max is defined in the sense of String comparison: I mean that for me, "013" < "023" and "A03" "003" in accordance to the Strcomp function. Thanks, Sergio |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding Maximum of Two Numbers in Array | Excel Programming | |||
What is the maximum number of unique strings in Excel 2003 | Excel Programming | |||
Finding Location of Maximum Value in 2D Array | Excel Discussion (Misc queries) | |||
Finding Location of Maximum Value in 2D Array | New Users to Excel | |||
Finding Location of Maximum Value in 2D Array | Excel Worksheet Functions |