+ Reply to Thread
Results 1 to 7 of 7

dont want subtraction if answer is -ve number

  1. #1
    Registered User
    Join Date
    05-19-2013
    Location
    mumbai,india
    MS-Off Ver
    Excel 2007
    Posts
    22

    dont want subtraction if answer is -ve number

    I have formula in cell K5 as shown below
    =IF(35-K6<=0,0,IF(35-K6>10,0,IF(35-$E6+35-$G6+35-$I6+35-$K6+35-$M6>20,0,35-K6)))
    In underlined section there is 35-E6,35-G6, 35-I6, 35-K6, 35-M6
    In these sections i want subtraction only if answer is +ve. I have tried IF function but excel does not allow to put if in successive + signs
    I am attaching sample file.


    resultsample.xlsx

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

    Re: dont want subtraction if answer is -ve number

    Try
    =IF(35-K6<=0,0,IF(35-K6>10,0,IF(((35-$E6)*(35-$E6>0))+((35-$G6)*(35-$G6>0))+((35-$I6)*(35-$I6>0))+((35-$K6)*(35-$K6>0))+((35-$M6)*(35-$M6>0))>20,0,35-K6)))
    Click * below if this answer helped

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: dont want subtraction if answer is -ve number

    35-$E6 so if e6 =35 the result is 0 is that still included?

    35-$E6 so if e6 =36 which is -1 is that treated as 0 or 35
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    05-19-2013
    Location
    mumbai,india
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: dont want subtraction if answer is -ve number

    Dear Sir,
    your formula worked well.Thanks for kind attention to my question

  5. #5
    Registered User
    Join Date
    05-19-2013
    Location
    mumbai,india
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: dont want subtraction if answer is -ve number

    it should be treated as zero

  6. #6
    Registered User
    Join Date
    05-19-2013
    Location
    mumbai,india
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: dont want subtraction if answer is -ve number

    Quote Originally Posted by martindwilson View Post
    35-$E6 so if e6 =35 the result is 0 is that still included?

    35-$E6 so if e6 =36 which is -1 is that treated as 0 or 35
    it should be treated as zero

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: dont want subtraction if answer is -ve number

    in that case
    =IF(35-K6<=0,0,IF(35-K6>10,0,IF(175-MIN(35,E6)-MIN(35,G6)-MIN(35,I6)-MIN(35,K6)-MIN(35,M6)>20,0,35-K6)))

+ 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. Calculate number of days between 2 dates & then assign a number based on the answer
    By MrHappyGoLucky12 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-27-2014, 09:20 PM
  2. Replies: 1
    Last Post: 04-12-2011, 06:46 PM
  3. subtraction: Date1 - Date2 = number of days
    By delizoki66 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2010, 10:06 AM
  4. Replies: 1
    Last Post: 12-14-2009, 05:20 PM
  5. the answer dont display just the formula i input help
    By Dimetre in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 06-25-2005, 06:05 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