+ Reply to Thread
Results 1 to 15 of 15

Can someone please help! Formula Question

  1. #1
    Registered User
    Join Date
    09-30-2006
    Posts
    8

    Can someone please help! Formula Question

    Hi, i'm new to excel and only know the basics and i'm stuck! It's probably very simple - example, A1 is STOCK LEVEL and B2 is STOCK ISSUED, in A1 there is 30 and in B2 there is 0. How can i make it so when i change B2 to 1, A1 goes down to 29? Please can someone help me?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try =30-B1

    However I would use 3 columns. One for Stock, Stock Issue and the final one for balance e.g =A1-B1


    VBA Noob

  3. #3
    Registered User
    Join Date
    09-30-2006
    Posts
    8
    I don't really want to use 3 columns. Can anyone help?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Then use this in A1

    =30-B1

    VBA Noob

  5. #5
    Registered User
    Join Date
    09-30-2006
    Posts
    8
    Thanks it works a treat. Problem now is when a1 gets to 0 the formula is reset, can i stop this?

  6. #6
    Registered User
    Join Date
    09-30-2006
    Posts
    8
    Anyone?

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    What do you mean reset.

    Can you tell us what your expected results are etc

    VBA noob

  8. #8
    Registered User
    Join Date
    09-30-2006
    Posts
    8
    hi, when a1 gets down to 10 i need to restock the product back up to 30 but when i enter 30 the formula stops working. thanks

  9. #9
    Registered User
    Join Date
    09-30-2006
    Posts
    8
    Along these same lines - is there a formula where it will take 1 from a1 and add it to b2 regardless of what figure is in a1?

  10. #10
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by nokmond
    Along these same lines - is there a formula where it will take 1 from a1 and add it to b2 regardless of what figure is in a1?
    Perhaps to explain why not,

    'Formula' exists in a Cell and the calculated outcome of the formula is reflected in the cell.

    A formula cannot 'poke' information to another cell, but can only present an answer which other cells may use.

    A formula in A1 that uses B2 to set it's value, coupled with a formula in cell B2 that uses A1 to set it's value is classified as 'circular' (or recursive)

    However, there is VB code that can perform what you ask, and the code can be triggered by a variety of methods, including a menu bar option, a button, or a Macro (Run the Macro) etc.

    Such code could set A1 down 1 and B2 up 1

    Does this help?
    ---

  11. #11
    Registered User
    Join Date
    09-05-2006
    Posts
    13

    Try This formula..works for me

    IF(('RACK #1'!I35-'RACK #1'!H35)<=19,0,'RACK #1'!I35-'RACK #1'!H35)

    The restock variable "19" can be changed to reflect any number

    The rack is just my location, normally is would say cell or something close

  12. #12
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by rkaiser
    IF(('RACK #1'!I35-'RACK #1'!H35)<=19,0,'RACK #1'!I35-'RACK #1'!H35)

    The restock variable "19" can be changed to reflect any number

    The rack is just my location, normally is would say cell or something close
    The OP wants to keep Stock, Stock Issued and Stock level, but without using 3 cells, so I doubt that a second sheet would be acceptable. I think a button-triggered version of VBA Noob's formula to -1 from A1 and +1 to B1 will probably eventuate.

    Just waiting for the OP to reply.
    ---

  13. #13
    Registered User
    Join Date
    09-30-2006
    Posts
    8
    hi, yes i want to just use 2 columns. I would appreciate more advise on how to do it. Thanks jon

  14. #14
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by nokmond
    hi, yes i want to just use 2 columns. I would appreciate more advise on how to do it. Thanks jon
    To use only two cells you will be (seriously) asking for problems, along the lines that you have no audit trail to follow, and no check to ensure accuracy that the three cells would provide, ie Start Stock - Used = Current Stock, you can check back to see what the Start Stock should be, and verify that the Current Stock is that 'on the shelf'

    However, to use just two cells and increase one whilst reducing the other, you will need a trigger to 'Do' the subtract, usually a Button.

    To add a button
    Select View, Toolbars, Control Toolbox
    The first icon toggles into/out of 'Design Mode'
    In Design mode, select the Button and draw a shape where you want the button.
    Rightmouse that button and select View Code and amend the code to look like
    Please Login or Register  to view this content.
    where A1 and B1 represent your two cells.

    Rightmouse and select Properties and enter a Caption and select a Backcolour from the Palette tab.
    Position and size the button to suit.

    Exit design mode and clear that menu window, and then a click of the button will reduce/increase as required.

    Hope this helps
    ---
    Last edited by Bryan Hessey; 10-04-2006 at 09:07 PM.

  15. #15
    Registered User
    Join Date
    09-30-2006
    Posts
    8
    Thanks, i'll give it a try, might be a bit advanced for me tho!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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