Hi
I have 2 INDEX statements which extract a maximum of 2 data items from an array of 12 items. I now need to be able to extend this extraction to upto12 items from an array of 18.
The current two statements are:
=INDEX($CR$8:$DC$8,1,MATCH("M",$CR$9:$DC$9,0))
=INDEX($CR$8:$DC$8,1,MATCH("M",OFFSET($CR$9,0,MATCH("M",$CR$9:$DC$9,0),1,12),0)+MATCH("M",$CR$9:$DC$9,0))
These 2 statements act on 2 arrays: one has 12 sets of staff initials housed in 12 separate cells and directly below is the data array of shifts being worked containing M,A,N,O representing morning, afternoon, night and off.
The first statement extracts the first occurrence of “M”, and the second finds the next “M”then selects the corresponding initials of the person working those 2 shifts.
A sample of the array could be:
Initials Array…………….BC DE FG H J K LPQ (I’ve just used single letters for simplicity)
Data Array……………….AAOOMMOOOONN
So in this example, I would be looking for a solution of F and G.
Now what I want to achieve is to extract all the “O”s, so in this case the solution would be D,E,H,J,K and L, but the new arrays will have 18 sets of initials, and the data array will have 18 shifts. Could someone suggest how the statements could be updataed/added to accommodate the changes. Hope I’ve explained this clearly enough.
Many Thanks
I have 2 INDEX statements which extract a maximum of 2 data items from an array of 12 items. I now need to be able to extend this extraction to upto12 items from an array of 18.
The current two statements are:
=INDEX($CR$8:$DC$8,1,MATCH("M",$CR$9:$DC$9,0))
=INDEX($CR$8:$DC$8,1,MATCH("M",OFFSET($CR$9,0,MATCH("M",$CR$9:$DC$9,0),1,12),0)+MATCH("M",$CR$9:$DC$9,0))
These 2 statements act on 2 arrays: one has 12 sets of staff initials housed in 12 separate cells and directly below is the data array of shifts being worked containing M,A,N,O representing morning, afternoon, night and off.
The first statement extracts the first occurrence of “M”, and the second finds the next “M”then selects the corresponding initials of the person working those 2 shifts.
A sample of the array could be:
Initials Array…………….BC DE FG H J K LPQ (I’ve just used single letters for simplicity)
Data Array……………….AAOOMMOOOONN
So in this example, I would be looking for a solution of F and G.
Now what I want to achieve is to extract all the “O”s, so in this case the solution would be D,E,H,J,K and L, but the new arrays will have 18 sets of initials, and the data array will have 18 shifts. Could someone suggest how the statements could be updataed/added to accommodate the changes. Hope I’ve explained this clearly enough.
Many Thanks