## Index of max function

##### Index of max function
 Author Message Andrew Papale posted 2 Months Ago ANSWER HOT Group: Forum Members Posts: 58, Visits: 205 Dear Inquisit Team,What is the best way to find the index of a value in the max function?i.e. index of max(4,0,1,3,2) would return 2, index of max(2,3,4,1,5) would return 4.I feel like there might be a way to do this with lists:  https://www.millisecond.com/support/docs/current/html/language/functions/indexof.htmThanks,Andrew Andrew Papale Group: Forum Members Posts: 58, Visits: 205 +x Andrew Papale - 10/2/2023Dear Inquisit Team,What is the best way to find the index of a value in the max function?i.e. index of max(4,0,1,3,2) would return 1, index of max(2,3,4,1,5) would return 5.I feel like there might be a way to do this with lists:  https://www.millisecond.com/support/docs/current/html/language/functions/indexof.htmThanks,AndrewNot sure how to edit, but obviously the examples I gave would be for the min function.  For the max, we would return 1 and 5, respectively, thanks Andrew Papale Group: Forum Members Posts: 58, Visits: 205 +x Andrew Papale - 10/2/2023+x Andrew Papale - 10/2/2023Dear Inquisit Team,What is the best way to find the index of a value in the max function?i.e. index of max(4,0,1,3,2) would return 1, index of max(2,3,4,1,5) would return 5.I feel like there might be a way to do this with lists:  https://www.millisecond.com/support/docs/current/html/language/functions/indexof.htmThanks,AndrewNot sure how to edit, but obviously the examples I gave would be for the min function.  For the max, we would return 1 and 5, respectively, thanksThis solution seems to work for values <=5 but is not general to any integer N without N if else statements./ items = (values.rem0, values.rem1, values.rem2, values.rem3, values.rem4, values.rem5)/ poolsize = 6/ selectionrate = always Dave posted 2 Months Ago ANSWER Group: Administrators Posts: 12K, Visits: 95K +x Andrew Papale - 10/2/2023+x Andrew Papale - 10/2/2023+x Andrew Papale - 10/2/2023Dear Inquisit Team,What is the best way to find the index of a value in the max function?i.e. index of max(4,0,1,3,2) would return 1, index of max(2,3,4,1,5) would return 5.I feel like there might be a way to do this with lists:  https://www.millisecond.com/support/docs/current/html/language/functions/indexof.htmThanks,AndrewNot sure how to edit, but obviously the examples I gave would be for the min function.  For the max, we would return 1 and 5, respectively, thanksThis solution seems to work for values <=5 but is not general to any integer N without N if else statements./ items = (values.rem0, values.rem1, values.rem2, values.rem3, values.rem4, values.rem5)/ poolsize = 6/ selectionrate = always