Categories in Data Tables?

alohafromHI

New Member
Joined
Oct 15, 2016
Messages
3
Hi everyone,

So for the sake of an example, say I want to calculate a prices per pound, but there are different colored containers that indicate different prices. Like a red container is $1/pound, a green container is $2/pound and a blue container is $3/pound. So my Data Table would look something like below (w/o equations):

ColorWeight (lbs.)Price
Red1=[@weight]*1 = $1
Green1=[@weight]*2 = $2
Blue1=[@weight]*3 = $3

<tbody>
</tbody>

So if someone is buying 1 pound of something, the price would be different depending on which color container it is in: $1 in red container, $2 in green, and $3 in blue. But since the formulas for each container are different, Data Tables gets messed up (so the table above isn't actually possible). Is there a way that I can somehow set a category for the container color that would dictate which equation Excel would use based on the category I select? Or would I just need to make a separate data table for the red containers, one for the blue, and one for the green?

Thanks
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I'm not quite clear what you are asking for, but it seems to me that all you really need is a simple table like this:


Excel 2016 (Windows) 32 bit
AB
1Red1
2Green2
3Blue3
Sheet1


Then your formula will be something like this:


Excel 2016 (Windows) 32 bit
ABC
5Green1224
Sheet1
Cell Formulas
RangeFormula
C5=B5*VLOOKUP(A5,$A$1:$B$3,2)
 
Upvote 0
Sorry, I didn't really make it clear...

But the VLOOKUP function, from what I understand, is to look up items and values that already exist in an extensive table. In this case, I want to be able to input the color and weight of the container and I want excel to auto calculate the price and I want to keep adding to the table as each container is sold. But because the price per weight of the different colored containers are different, I want to figure out if I could somehow set different formulas to calculate prices based off which color container I choose.

I was just wondering for efficiency's sake because like if I set the red container to be $1.75/pound and someone comes and buys 4.72 pounds of something, I want to just be able to input "red container" and "4.72 pounds". Then excel would auto calculate 4.72*1.75 rather than me having to input the 1.75 every single time someone comes with a red container. Sorry, I feel like I'm just making this more confusing. Hope that helped at least a little

I'm not quite clear what you are asking for, but it seems to me that all you really need is a simple table like this:


Excel 2016 (Windows) 32 bit
AB
1Red1
2Green2
3Blue3
Sheet1


Then your formula will be something like this:


Excel 2016 (Windows) 32 bit
ABC
5Green1224
Sheet1
Cell Formulas
RangeFormula
C5=B5*VLOOKUP(A5,$A$1:$B$3,2)
 
Upvote 0
That's what my suggested solution is doing. In A5 you input the colour of the container (you could have a drop-down list to select from, if you wanted to). In B5, you input the number you need multiplying. The formula in C5 then looks up the value of your chosen colour in the lookup table and multiplies it by the number in B5 - your £1.75 goes in the lookup table next to the cell that says "Red". From what you have said so far, I cannot see how this does not fit the brief, so if it doesn't, you are going to need to make your requirements clearer.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,730
Messages
6,126,528
Members
449,316
Latest member
sravya

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