archangel99
New Member
- Joined
- Sep 22, 2010
- Messages
- 7
Hi
I am trying to help my colleague solve a simple problem on allocation. In the spreadsheet shown in the image below, each of the students has three choices of classes – A, B and C. Each class has a max capacity. The challenge is to allocate students to their lowest choice subject to the availability of max capacity.
The challenge I am facing was not being able to wrap the array made from comparison into an index statement. If I were to use helper cells, the answer worked out perfectly.
The formula for the helper cell is shown in the image.
Column H contains the allocated choice.
Cell H2: A <- first case always allocated first choice
Cell H3: =INDEX(A3:C3,,MATCH(TRUE,E3:G3,0))
Cell H4: INDEX(A4:C4,,MATCH(TRUE,E4:G4,0))
Why can’t I wrap the array (computed from the countif) into the index formula?
I also take this opportunity to thank you in advance.
I am trying to help my colleague solve a simple problem on allocation. In the spreadsheet shown in the image below, each of the students has three choices of classes – A, B and C. Each class has a max capacity. The challenge is to allocate students to their lowest choice subject to the availability of max capacity.
The challenge I am facing was not being able to wrap the array made from comparison into an index statement. If I were to use helper cells, the answer worked out perfectly.
The formula for the helper cell is shown in the image.
Column H contains the allocated choice.
Cell H2: A <- first case always allocated first choice
Cell H3: =INDEX(A3:C3,,MATCH(TRUE,E3:G3,0))
Cell H4: INDEX(A4:C4,,MATCH(TRUE,E4:G4,0))
Why can’t I wrap the array (computed from the countif) into the index formula?
I also take this opportunity to thank you in advance.