If cell contains value, subtract from multiple cells

PreppieCrown

New Member
Joined
Mar 7, 2019
Messages
1
Hi guys,

I'm relatively new to Excel and need to use it for a uni assignment. Basically, I'm testing out the economy of a cafe simulator game, checking to see if the values of ingredients are appropriate for players to complete a level.

The orders that arrive are randomly generated, and I have that set up. The numbers generated correlate to a customer order. For eg: 1 = Bacon and Eggs.

What I want to do is to check if the cell either says "1", "2", or "3" and take away a quantity. For example, if 1 has been randomly generated, take away 2 from two seperate cells that correlate to an ingredients list.
So:
The customer has ordered Bacon and Eggs (1) and I need to take away 2 Bacon and 2 Eggs from ingredients.

I'm also not entirely sure on where to put the formula or potential formulas for it to work effectively.

I've tried the If formula, and Countif and none of them seem to do what I want, I could just be doing it entirely wrong though.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,714
Messages
5,833,276
Members
430,201
Latest member
Deepakpilla36

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
Top