+ Reply to Thread
Results 1 to 2 of 2

If cell contains value, subtract from multiple cells

  1. #1
    Registered User
    Join Date
    03-06-2019
    Location
    Sydney, Australia
    MS-Off Ver
    MS Office 365
    Posts
    1

    If cell contains value, subtract from multiple cells

    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.
    Last edited by PreppieCrown; 03-06-2019 at 11:12 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: If cell contains value, subtract from multiple cells

    LOL.

    Take this One Stage at a time.

    First you need a row or column where you list your stock. So Lets assume Row 1 is used for titles, Row 2 is your initial stock.
    Keep Row 3 spare for your formula to count the used ingredients. =sum(B5:B2000)
    Row 4 = Row2 - Row3 present stock level.

    So Maybe you start the day with 200 Rashers of Bacon, 36 Eggs, 48 Slices of Bread.

    Under Eggs you will need a formula to calculate the number of eggs used.

    so in Column A a 1 means Bacon & Eggs. Maybe 2 means Spanish Omelette, ie 3 eggs

    =IF(A5="","",CHOOSE(A5,2,3,4,5,7,8))

    This formula will return 2 if A4 =1 or 3 if A4 =2
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. subtract multiple cells if conditions are met
    By Aeducan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-27-2019, 03:48 AM
  2. [SOLVED] Use current value and subtract from multiple cells
    By EspenKalland in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2018, 12:11 PM
  3. How to subtract multiple cells from a signle value
    By JustBringIt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-06-2016, 10:29 AM
  4. Is there a shortcut key that will subtract multiple cells?
    By cmorten82 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-29-2015, 03:00 AM
  5. New to Excel and need help with subtract multiple cells for one cell
    By rpbrown88 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-13-2013, 08:56 PM
  6. [SOLVED] How to subtract multiple cells from a cell and report soldout when main number reaches 0
    By QuietForce in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2012, 01:43 AM
  7. [SOLVED] Add and Subtract ranges (with multiple cells) in vba
    By Jon5001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2005, 02:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1