| T O P I C    R E V I E W | 
               
              
                | Wellsyfred | 
                Posted - 10/03/2014 : 12:48:29 AM  Hi,
  I have multiple large datasets and am trying to programmatically find the maximum of each.
  For example, if I had the data:
  X    Y1    Y2    Y3 1    2     7     3 2    43    65    23 3    44    34    60
 
  I would want it to return 44, 65, 60
  Additionally, I would like to find the X values corresponding to these maximum values. For my example these would be 3, 2, 3.
  I have tried using max(Col(A1)) and inserting each column manually, which works fine, but would be painstaking to type out for hundreds of columns...
  Origin Ver. 8.6, Windows 7
 
  Thanks so much! | 
               
              
                | 2   L A T E S T    R E P L I E S    (Newest First) | 
               
              
                | Wellsyfred | 
                Posted - 10/04/2014 : 01:31:10 AM  This worked perfectly!
  Thanks so much :) | 
               
              
                | greg | 
                Posted - 10/03/2014 : 09:13:44 AM  Right-click on the Title Bar of your Workbook and choose "Show Script Panel". In the lower panel, paste the following script: // BEGIN SCRIPT wks.userparam1$ = Max; wks.userparam1 = 1; wks.userparam2$ = at X; wks.userparam2 = 1; loop(ii,2,wks.ncols) { 	limit wcol(ii); 	wcol(ii)[Max]$ = $(limit.ymax,*5); 	wcol(ii)[at X]$ = $(limit.imax); } // END SCRIPT Click the Execute button. | 
               
             
           | 
         
       
       
     |