+ Reply to Thread
Results 1 to 19 of 19

BEER-related: Subtract lbs of malt in inventory based on beer recipe.

  1. #1
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    Hello,

    I am trying to create a formula that would:
    Match value in Recipe!D13 to the value in GRAINLOOKUP!A3:A200, then subtract Recipe!B13 from J3 of the row of match in GRAINLOOKUP!A3:A200

    I would like to be able to run this formula by clicking on a button....

    beer.png
    Last edited by mngeo; 01-03-2019 at 05:28 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Match Index Subtract formula with button

    You want to find the value in column J of GRAINLOOKUP based on the values in column A?

    =VLOOKUP(Recipe!D13, GRAINLOOKUP!A:J,10,False)

    And maybe this (your explanation is not really clear)

    =VLOOKUP(Recipe!D13, GRAINLOOKUP!A:J,10,False) - Recipe!B13

    Formulas are recalced automatically - if that is your setting - or by pressing F9.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    Re: Match Index Subtract formula with button

    Ok. I will explain more in-depth.

    I have a beer recipe sheet named Recipe.....the amount/lbs of grain is in cell B13 and the malt type is in D13.
    I have an inventory of malt types in sheet GRAINLOOKUP.....the malt type is in A3 through A200 and the inventory/lbs of each malt is in J3 through J200.

    So, after each brew is over, I want to be able to click on a button to subtract the amount/lbs of grain in B13 of sheet Recipe from the inventory/lbs of that malt in GRAINLOOKUP

    beer.png
    Last edited by mngeo; 01-03-2019 at 05:32 PM.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Match Index Subtract formula with button

    A macro like this may work - assign it to your button:


    Please Login or Register  to view this content.
    But if you want to adjust all the grain levels:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    Re: Match Index Subtract formula with button

    You Sir, deserve beer! Thank you so much for helping me out!
    Happy New Year.

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Match Index Subtract formula with button

    I prefer cider

  7. #7
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    Re: Match Index Subtract formula with button

    Ok Bernie,
    I have another one for you. I want to do the same for HOPLOOKUP sheet, the only issue is I have hops and amounts in three different places on the Recipe sheet:

    hops.PNG

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Match Index Subtract formula with button

    Is all this because I said I like cider?

    Anyway, try it like this - I have assumed that the names and inventory levels on HOPLOOKUP are structured similarly to GRAIN...


    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    Re: Match Index Subtract formula with button

    Yes, this all because you like cider and not beer ;-)

    I tried the code, but I get this error:

    mismatcherror.PNG

    beerhops.PNG

  10. #10
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: Match Index Subtract formula with button

    When you get that error, replace that line with these:

    Msgbox "Hop level is " & .Value
    MsgBox "Usage is " & rngC.Offset(0, 3).Value

    What do the message say?

    OR can you attach your workbook?

  11. #11
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    Re: BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    I have attached the workbook:
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    OK.

    1) the values are in C and not J on the HOPS sheet
    2) I was off by one column with my offset (my bad)
    3) you have inconsistent merging of columns relative to data entry

    To fix 3, select column P and Q on Recipe and unmerge them, then delete column Q

    Then use this code:

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    Re: BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    Bernie,

    When I unmerge P and Q, I get this garbled mess. Is this what you wanted me to do?

    unmerge.PNG

  14. #14
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    Don't unmerge, but use this version:

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    Re: BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    After not unmerging and running the above code, I get this:

    mismatcherror3.PNG
    Attached Images Attached Images

  16. #16
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    Re: BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    After not unmerging and running the above code, I get this:

    mismatcherror4.PNG
    Attached Images Attached Images
    Last edited by mngeo; 01-04-2019 at 12:38 PM.

  17. #17
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    Move C2 on sheet HopsLookup to C1, and put a 0 into cell C2.

  18. #18
    Registered User
    Join Date
    01-03-2019
    Location
    Minneapolis, MN
    MS-Off Ver
    2013
    Posts
    10

    Re: BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    Bernie,

    Works great! Thank you a ton. Where do I send the cider?

  19. #19
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,945

    Re: BEER-related: Subtract lbs of malt in inventory based on beer recipe.

    Great - There used to be an 'attach drink' button but they had to remove it for legal reasons.....

+ 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. Index Match formula changing my Index daily
    By vitt4300 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-31-2017, 02:19 PM
  2. How to have the formula add or subtract 1 year in a Index -Aray formula
    By Meshell in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-02-2017, 10:59 PM
  3. [SOLVED] This formula works but I donīt understand why Index(Index) match
    By campelliann in forum Excel General
    Replies: 2
    Last Post: 01-25-2016, 05:55 PM
  4. Need help with VLOOKUP or INDEX/MATCH with Subtract formula
    By drheenas in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-05-2014, 07:14 PM
  5. Replies: 3
    Last Post: 05-02-2013, 01:31 AM
  6. Index Match Index Formula work slow
    By avk in forum Excel General
    Replies: 9
    Last Post: 03-07-2012, 02:19 PM
  7. Replies: 5
    Last Post: 02-29-2012, 08:51 PM

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