JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,691
- Office Version
- 365
- Platform
- Windows
Is there a good way to handle a situation in a table when the formulas in one or more columns vary from row to row?
This little table that compares the cost of candy bars has 2 records.
What if I add another field, maybe something like "Wt Type", which I could set to "Bag" or "Bar" to indicate what the weight applies to and then modify the formulas based on that?
Should I make two separate tables? If I do, how can I make the last 2 comparisons (columns K & L)?
This little table that compares the cost of candy bars has 2 records.
- In row 7, the large (49g) bars come 18 to a box. The weight of the box is not given.
- In row 8, the small (17g) bars come in a 320g bag. The number of bars is not given.
- Column E has the weight of each package (box or bag). In E7 it is calculated. In E8 it is given.
- Column F has the number of bars/package. In F7 it is given. In F8 is it calculated.
What if I add another field, maybe something like "Wt Type", which I could set to "Bag" or "Bar" to indicate what the weight applies to and then modify the formulas based on that?
Should I make two separate tables? If I do, how can I make the last 2 comparisons (columns K & L)?
$Table Test.xlsx | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
C | D | E | F | G | H | I | J | K | L | |||
5 | Bars | Package | This Order | |||||||||
6 | Product | Wt/Bar | Wt/Pkg | Bars/Pkg | #Pkgs | #Bars | Wt | Price | $/Bar | $/17g | ||
7 | Box of 36 large bars | 49g | 1,764g | 36 | 1 | 36 | 1,764g | $33.11 | $0.92 | $0.32 | ||
8 | 2 bags of small bars | 17g | 320g | 18 | 2 | 36 | 640g | $15.88 | $0.44 | $0.44 | ||
Test |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E7 | E7 | =[@[Wt/Bar]]*[@[Bars/Pkg]] |
H7:H8 | H7 | =[@[Bars/Pkg]]*[@['#Pkgs]] |
I7:I8 | I7 | =[@[Wt/Pkg]]*[@['#Pkgs]] |
K7:K8 | K7 | =[@Price]/[@['#Bars]] |
L7:L8 | L7 | =[@[$/Bar]]/([@[Wt/Bar]]/17) |
F8 | F8 | =ROUNDDOWN([@[Wt/Pkg]]/[@[Wt/Bar]],0) |