Originally Posted by
CAntosh
Your current setup for Cendect and Gren's optional countries makes a formula difficult, so I would advise a new approach. I built a separate table in A29:D39 on your "Guide" sheet. This new table pulls numbers from your existing data but ranks the PIC's for each country in the order that they should be assigned cases and lists the number of cases each one can handle per country. With this table in place, you can use the following formula in C2 on "Case". It must be array-entered (confirmed with Ctrl + Shift + Enter instead of Enter):
=IFERROR(INDEX(Guide!$B$30:$B$39,SMALL(IF((COUNTIFS($C$1:$C1,Guide!$B$30:$B$39,$B$1:$B1,Guide!$A$30:$A$39) < Guide!$D$30:$D$39)*([@Country]=Guide!$A$30:$A$39),ROW(Guide!$D$30:$D$39)-ROW(Guide!$D$30)+1),1)),"Tomorrow")
Fill it down through the table on "Case" and it should match what you're looking for without relying on any of the info in F:K of "Case". The only exception is Henry's Japan assignments. Leaving both Japan and Henry's totals blank on the "Guide" sheet fails to indicate whether you intend Henry to handle all Japan cases or no Japan cases. The formula treats a blank as zero, so he has not been assigned cases. If you want him to have cases, enter a target for Japan in B7 or for Henry in B17 and the formula will give him cases. If you want to assign him all of the Japan cases, use the following in B7:
=COUNTIF(Table1[Country],A7)
Take a look at the attachment to see if the new approach is helpful:
Bookmarks