Formulas to Exclude Items from one table based on criteria from a different table

gberg

Board Regular
Joined
Jul 16, 2014
Messages
180
Office Version
  1. 365
Platform
  1. Windows
I have a spreadsheet with two tables

Table 1 holds the main data and could be thousands of lines long
  • This is the table where the bulk data is held
  • Most data will have an "Area" assigned to it
  • There will be a few items that the area = "(unassigned)"

Table 2 will Distribute the "(unassigned)" items proportionally to the desired areas
  • Areas designated with "Exclude" will not have the values distributed

TABLE 1
A​
B​
C​
1​
AreaSectionValue
2​
(unassigned)Widget 1
1000​
3​
(unassigned)Widget 2
2000​
4​
(unassigned)Widget 3
3000​
5​
NorthSection 1
100​
6​
SouthSection 2
200​
7​
EastSection 3
300​
8​
WestSection 4
400​
9​
NorthSection 5
500​
10​
SouthSection 1
1000​
11​
EastSection 2
2000​
12​
NorthSection 3
3000​
13​
NorthSection 4
4000​
14​
WestSection 5
5000​
15​
WestSection 1
10000​
16​
EastSection 2
11000​
17​
SouthSection 3
12000​
18​
EastSection 4
13000​
19​
NorthSection 5
14000​



TABLE 2
A​
B​
C​
D​
1ItemsAreaDistributeValue
2Widget 1North583.78
3Widget 1SouthExclude
4Widget 1EastExclude
5Widget 1West416.22
6
7Widget 2NorthExclude
8Widget 2South480.87
9Widget 2East958.11
10Widget 2West561.02
11
12Widget 3NorthExclude
13Widget 3SouthExclude
14Widget 3East3,000.00
15Widget 3WestExclude

So in this example for Widget 1 I want to distribute the total value (1,000) to Areas "North" and "West" (note: these areas are just examples, there could be 2 areas or 100 areas)
The formula I am looking for is for column D to come up with the appropriate distributed values based on areas that are not designated as "Excluded" in column C
  • So the formula for D2 would be (North Value (21,600) / ((North (21,600)+West(15,400))))*Widget 1 value (1,000) = 583.78
I just don't know how to make a formula work to automatically calculate this
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi,

The way you have your TABLE 2 set up is not exactly formula friendly...
Also not sure if your 2 Tables are on the same sheet or not, so Add Sheet Name, Change/Adjust Cell References/Ranges as needed:

Book3.xlsx
ABCDEFGHI
1AreaSectionValueItemsAreaDistributeValue
2(unassigned)Widget 11000Widget 1North583.78
3(unassigned)Widget 22000Widget 1SouthExclude 
4(unassigned)Widget 33000Widget 1EastExclude 
5NorthSection 1100Widget 1West416.22
6SouthSection 2200 
7EastSection 3300Widget 2NorthExclude 
8WestSection 4400Widget 2South480.87
9NorthSection 5500Widget 2East958.11
10SouthSection 11000Widget 2West561.02
11EastSection 22000 
12NorthSection 33000Widget 3NorthExclude 
13NorthSection 44000Widget 3SouthExclude 
14WestSection 55000Widget 3East3000.00
15WestSection 110000Widget 3WestExclude 
16EastSection 211000
17SouthSection 312000
18EastSection 413000
19NorthSection 514000
Sheet915
Cell Formulas
RangeFormula
I2:I15I2=IF(OR(F2="",H2<>""),"",SUMIFS(C$2:C$19,A$2:A$19,G2)/SUM(SUMIFS(C$2:C$19,A$2:A$19,IF((F$2:F$15=F2)*(H$2:H$15=""),G$2:G$15)))*SUMIFS(C$2:C$19,A$2:A$19,"(unassigned)",B$2:B$19,F2))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
That's awesome, worked perfectly! Thanks so much for your help
 
Upvote 0
You're welcome, thanks for the feedback.

Don't forget to mark the post that solved your question as solution. Thanks.
 
Upvote 0
Sorry for the delay, just marked as "Solved"
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,051
Latest member
excelquestion515

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