Dynamic: Finding the Min and assigning to that category

Magoosball

Board Regular
Joined
Jun 4, 2017
Messages
70
Office Version
  1. 365
I have a spreadsheet with 2 separate sheets set up as follows:

Assignment:
Department BucketShift
StateProduct
Home HealthNights
ToysNights
Sporting GoodsNights
GroceryDays
ToysDays
FurnitureDays
PetsDays

<tbody>
</tbody>

Summary:
StateDepartment BucketProductShiftNumber
AlabamaHome HealthShampooNights1567
AlabamaToysCarsNights900
MarylandToysBarbiesNights897
WyomingHome HealthConditionerNights1570
MarylandSporting GoodsBasketballNights65
MarylandGroceryHot DogsDays5
CaliforniaPetsDogsDays98
CaliforniaGroceryBurgersDays74

<tbody>
</tbody>


The number column is a count statement from the assignment tab. For example from the above data there would be 1567 rows on the assignment tab that have a state of Alabama, a shift of nights, a department of Home Health and a Product of Shampoo. Since it is a count statement, for each additional row added to the assignment tab with Alabama, Home Health, Nights, and Shampoo, the number column on the summary spreadsheet would go up by 1.

The goal of this is to fill in the state and the product columns on the Assignment spreadsheet that has the lowest Number from the summary tab. Below I have typed out a few of the expected results.

1) Home Health Nights on the assignment tab -- The first 4 rows that have this on the assignment tab will be populated with Shampoo and Alabama. This would put the count of Alabama, Home Health, Shampoo, Nights at 1571 now. Since that is now greater than 1570 the next one will be assigned to Wyoming, Home Health, Conditioner, Nights. From here on out each row the formula is dragged down to that has these values should rotate between Alabama, Home Health, Shampoo, Nights AND Wyoming, Home Health, Conditioner, Nights.

2) Toys Nights on the assignment tab -- Each row on the assignment tab will be populated with Maryland and Barbie.

3) Grocery days on the assignment tab -- the first 69 should be assigned to Maryland Hot Dogs. The 70th row of this combination would be assigned to California burgers, and for each row after they would begin to rotate.

Is it possible to create this with formulas? Any helper columns are allowed. vb is allowed if needed.
I'm struggling because I'm getting a circular reference between the 2 tabs.

Any help setting this up or the formulas to make this happen would be greatly appreciated.
Thank you so much!
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi mate,

This seems to be returning the correct state & product for the lowest Summary value?


Book1
ABCD
1Department BucketShiftStateProduct
2Home HealthNightsAlabamaShampoo
3ToysNightsMarylandBarbies
4
5Sporting GoodsNightsMarylandBasketball
6GroceryDaysMarylandHot Dogs
7ToysDays
8FurnitureDays
9PetsDaysCaliforniaDogs
Assignment
Cell Formulas
RangeFormula
C2{=IFNA(INDEX(Summary!$A$2:$A$9,MATCH(MIN(IF(Summary!$B$2:$B$9&Summary!$D$2:$D$9=A2&B2,Summary!$E$2:$E$9)),Summary!$E$2:$E$9,0)),"")}
D2{=IFNA(INDEX(Summary!$C$2:$C$9,MATCH(MIN(IF(Summary!$B$2:$B$9&Summary!$D$2:$D$9=A2&B2,Summary!$E$2:$E$9)),Summary!$E$2:$E$9,0)),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,946
Messages
6,122,401
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top