+ Reply to Thread
Results 1 to 5 of 5

add or subtract numbers in one cell dependig which numbers in another cell

  1. #1
    Registered User
    Join Date
    12-17-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    12

    add or subtract numbers in one cell dependig which numbers in another cell

    Hello,

    I need some help with creating a macro that adds or subtracts numbers in one cell dependig which numbers in another cell.

    For exampel: In cell W9 the value is -3,9 and the value in cell E9 is 0, then I want my macro to add 4 in cell E9.


    In my document, cell E9 controlls how many units I have to order depending on the ingoing buffer in cell W9.

    Cell E9 is always gonna start with the value 0 and should never have decimals.
    Cell W9 is gonna start on any value (depending ingoing buffer) over or under zero.
    The macro has to end when the value in cell W9 is between 0 and 1.

    Looking forward to some good answers

    //Peter

  2. #2
    Forum Contributor
    Join Date
    01-30-2013
    Location
    Wales
    MS-Off Ver
    Excel 2013
    Posts
    231

    Re: add or subtract numbers in one cell dependig which numbers in another cell

    Why not use a formula?

    =IF(W9<0,-ROUNDUP(W9,0),ROUNDDOWN(W9,0))

  3. #3
    Registered User
    Join Date
    12-17-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: add or subtract numbers in one cell dependig which numbers in another cell

    That doesn't work

  4. #4
    Registered User
    Join Date
    12-17-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: add or subtract numbers in one cell dependig which numbers in another cell

    Quote Originally Posted by Chris 53 View Post
    Why not use a formula?

    =IF(W9<0,-ROUNDUP(W9,0),ROUNDDOWN(W9,0))
    The reason I can't use this formula is that I get a circular reference because cell W9 is connected to cell E9 with another formula.

  5. #5
    Registered User
    Join Date
    12-17-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: add or subtract numbers in one cell dependig which numbers in another cell

    Help me please!

+ 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. [SOLVED] Getting Excel 2007 to list the cell numbers of the top five ranked numbers in a column.
    By Securitysports in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-02-2013, 11:42 AM
  2. Replies: 11
    Last Post: 10-16-2013, 10:21 PM
  3. Subtract value from cell numbers referenced in formulas
    By m.g.williams in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2013, 12:42 PM
  4. Replies: 6
    Last Post: 11-03-2011, 04:44 PM
  5. Replies: 1
    Last Post: 01-09-2006, 09:30 AM

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