boliva 0 Posted Wednesday at 01:24 PM Is there a way to easily find the second highest or third highest value in an array? I know I can use Max/Min, but not sure if I wanted to find the two highest values how to find the next easily? Share this post Link to post Share on other sites
AzeoTech 0 Posted Wednesday at 05:08 PM Well, there isn't a built in function for this like min2() or min(val, 2) or something, but it is not hard to do using boolean math, especially if all the values are > 0. You'd basically have to iterate through, removing values as you go using boolean math: private themax = max(myArray) private themax2 = max(myArray * (myArray < themax)) private themax3 = max(myArray * (myArray < theMax2)) etc... Share this post Link to post Share on other sites