So what exactly do you have? I don't know if you have an array or a table. To get c1,c2,c3, and c4 from a table you do
c1 = t.c1;
c2 = t.c2;
c3 = t.c3;
c4 = t.c4;
To get c1,c2,c3, and c4 from an array you do
c1 = c(:, 1);
c2 = c(:, 2);
c3 = c(:, 3);
c4 = c(:, 4);
Then to do
IF(AND(C1>C2,C1>C3,C1>C4),1,IF(AND(C2>C1,C2>C3,C2>C4),2,IF(AND(C3>C1,C3>C2,C3>C4),3,4)))
you need to specify whether you want that done on a row by row basis , or if all elements (all rows) in something like C1>C2 need to be true. Which is it?
Best Answer