Scan through DM[1..48]. The following code scans through DM and records the maximum value in A and the index to this value in B:
A = -1 ' start with a value that is less than minimum data value
B = 0 ' illegal index into DM[]
for I = 1 to 48
if DM > A
' value in DM is greater than previous maximum value
' Remember it...
A = DM
B = I
endif
next
Not much to it! You can easily add another test to check for minimal values within the same for/next loop
Gary d.