{S:X;X;0;0;Using the Index Function{ITR-X}by Gerald L Fitton}
{S:X;X;0;1;Keywords:{ITT-X}Index Fitton}
{S:X;X;0;2;The syntax for using the function index(range,col,row,cols,rows) is given on page ### of the Resultz User Guide. }
{S:X;X;0;3;As an example of its use have a look at the file [Index] which was created by that deviously shrewd mathematician Robert Macmillan.}
{S:X;X;0;4;The file consists of a simple one dimensional column array in column c, two values in b6 and b7 and an \Éanswer\æ in b10. What happens is that the result in b10 is the sum of some of the numbers in the array. The number of numbers to add together is in slot b7 and the starting point is in slot b6.}
{S:X;X;0;5;Change the values in b6 or b7 and you will see the result change.}
{S:X;X;0;6;Have a look at the formula in b10: sum(index(c6c23,1,b6,1,b7)).}
{S:X;X;0;7;When sum(array) has a range or an array as its argument the result returned is the sum of every element in the range or array.}
{S:X;X;0;8;The index(range,col,row,cols,rows) function returns an array consisting of \Écols\æ columns and \Érows\æ rows so there are (rowsá*ácols) elements in the array. The arguments \Écol\æ and \Érow\æ specify which element is at the top left of the new array. In the example we have only one column so that the second and fourth arguments of the index(,,,,) function have to be 1. The third argument is the \Éoffset\æ from the start of the array, counting the first element as \Éoffset value\æ = 1. In our example this is 5.}
{S:X;X;0;9;The sum(index(range,col,row,cols,rows)) function adds the 7 numbers from the array 5á+á6á+á7á+á8á+á9á+á10á+á11á=á56 starting at the 5th.}
{S:X;X;0;10;One more feature of the example can be seen if you place the cursor in slot a10. You will see that the numbers are referenced using b7 and b6 so that they change automatically when the values in slots b7 and b6 are changed.}
{S:X;X;0;11;Of course, you don\æt have to use sum(array). You can use any function which will operate on an array. These include max(array) and even lookup(key,array1,array2). If you have an example of the use of array functions which you think will be of general interest then I shall be pleased to hear from you.}