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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,214,667
Messages
6,120,822
Members
448,990
Latest member
rohitsomani

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