+ Reply to Thread
Results 1 to 8 of 8

Calc >or <

  1. #1
    Forum Contributor
    Join Date
    05-16-2017
    Location
    Spain
    MS-Off Ver
    2010
    Posts
    103

    Calc >or <

    Good morning, I am trying to solve a doubt that I have in a formula. In cell A if the value is equal to or less than 0 calculate cell A with B, but if it is greater than zero it should not add to cell B. Thanks.
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Calc >or <

    This is a rather compact way to do it.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Calc >or <

    In C2 copied down:

    =IF(A1<=0,SUM(A1:B1),B1)
    Last edited by AliGW; 05-30-2017 at 01:15 PM. Reason: Silly tyop!!! :)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Contributor
    Join Date
    05-16-2017
    Location
    Spain
    MS-Off Ver
    2010
    Posts
    103

    Re: Calc >or <

    Thanks for the answers, the formula: error appears when I paste it in Excel, I have not been able to test it. The first one I think works, I'll try the file I need to see if it works. When you try it, notice if it works.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Calc >or <

    Which of us are you addressing? If my solutions are untested, I say so. Here they have been tested. See below:

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    1
    2170
    2106.82
    63.18
    Sheet: Sheet1

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    1
    2170
    =A1-(A1*0.029)-0.25
    =A1-(A1-(A1*0.029)-0.25)
    Sheet: Sheet1

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Calc >or <

    Quote Originally Posted by AliGW View Post
    In C2 copied down:

    =IF(A1<=0,SUM(A2:B2),B2)
    This formula doesn't work because A1 should be A2.

    I have attached the original file with my formula, and a corrected version of Ali's formula. Both match your desired results.
    Attached Files Attached Files

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Calc >or <

    Well spotted! Doh!!! I'll amend my original post.

  8. #8
    Forum Contributor
    Join Date
    05-16-2017
    Location
    Spain
    MS-Off Ver
    2010
    Posts
    103

    Re: Calc >or <

    Thanks, it works perfectly. Thank you very much for your help.

+ 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] Calc Numbers with decimals and having the Decimal be moved to new column to be Calc
    By TwistedFaith in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-24-2015, 12:01 AM
  2. How do I set some wksht formulas to calc. manually and others to calc. automatically?
    By hoboking87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2013, 08:16 PM
  3. calc, if then, one by one
    By Paragons in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-02-2007, 09:04 PM
  4. [SOLVED] My calc key on Excel changes box to "Text" Box and doesn't calc ?
    By jack in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-08-2006, 02:35 PM
  5. [SOLVED] calc
    By RobcPettit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2006, 04:20 AM
  6. =If - how to tell it to calc certain %'s only
    By Crazymom999 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-03-2006, 05:25 PM
  7. [SOLVED] auto calc on, but have to edit (f2) cells to force re-calc..help!
    By Curt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-13-2006, 02:10 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