+ Reply to Thread
Results 1 to 5 of 5

Subtracting - variable conditions

  1. #1
    Registered User
    Join Date
    12-20-2006
    Posts
    34

    Subtracting - variable conditions

    What is needed - If either or both cells A4 and A5 =0 then cell A3 needs to subtract from either or both cells B4 and/or B5 as well as subtracting A3-B3
    Below is the formula I've tried but it's not working
    =IF(A4=0,A3-B4,IF(A5=0,A3-B5,IF(A4>0,A3-B3,IF(A5>0,A3-B3))))
    As you can see from the result shown in the box, its wrong. The answer should be 69.

    Please see attachment

    Can anyone help
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-23-2006
    Posts
    185
    See if this works.
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    Sumif()

    As I understand you only want to subtract the value in col. B if the same row value in col. A is 0.
    This rule does not apply to B3 which always have to be subtracted from A3.
    =A3-B3-SUMIF(A4:A5,0,B4:B5)
    Hope this was what you were looking for.
    Ola

  4. #4
    Registered User
    Join Date
    12-20-2006
    Posts
    34

    Subtraction - variable conditions

    Hi Olasa,

    Thank you very much. It works perfectly and caters to all the criteria.

    Thanks to Additude as well. Your one covered most but not all the criteria.

    Regards

    Gary

  5. #5
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256

    ...

    Happy the formula was what your were looking for
    Thanks for the feedback
    Ola

+ 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