maximum number size/significant digits
Noel,
I have a slight guess as to why you want high precision for this task.
Anyway, my solution is very different. It is based on a formula I saw
from Bob Phillips, to find the collection of unique entries in a
dataset. It assumes that you have five functions in cells A1:A5. It
assumes you have a maximum of 4 roles per function (this will work for
up to 255 roles, as this hits the limit of columns). The roles are
placed next to the function, exactly as shown in your example, hence I
assume that the output cells start from G1. I.e. Column G:G will
contain a, b, c,... and subsequent columns, starting from H1, will have
the function codes.
In H1: (array formula, needs to be entered with Shift+Ctrl+Enter)
=IF(COUNTIF($B$1:$E$5,$G1)=0,"",INDEX($A$1:$A$5,MI N(IF(COUNTIF(OFFSET($B$1:$E$1,ROW($A$1:$A$5)-1,0),$G1)0,ROW($A$1:$A$5),1000))))
Copy down H1 as far next to the roles as necessary.
In I1: (also array formula)
=IF(H1="","",IF(ISERROR(MATCH(1,IF((COUNTIF(OFFSET ($B$1:$E$1,ROW($A$1:$A$5)-1,0),$G1)0)*(COUNTIF($H1:H1,$A$1:$A$5)=0),1,0),0) ),"",INDEX($A$1:$A$5,MATCH(1,IF((COUNTIF(OFFSET($B $1:$E$1,ROW($A$1:$A$5)-1,0),$G1)0)*(COUNTIF($H1:H1,$A$1:$A$5)=0),1,0),0) )))
Copy down and accross I1 as far as necessary.
What to change:
$A$1:$A$5 should be changed to whatever the length of your function
codes in the input table.
$B$1:$E$1 should be changed to a horizontal range wide enough to hold
the various roles for a function. If you do the restructuring in
another sheet it can be as wide as $B$1:$IV$1.
HTH
Kostis Vezerides
|