Consulting

Results 1 to 4 of 4

Thread: If formula - Can't get to work properly

  1. #1
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location

    If formula - Can't get to work properly

    Hi

    Looking for a bit of help with this formula,

    Basically it should be:

    If D5=0 then 0, else B5-D5, if B5 = 0 then 0 else B5 - D5

    Sounds easy when I write it but I can't get it to work at all

    Any help appreciated
    Attached Files Attached Files
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    An OR statement?
    =IF(OR(D5=0,B5=0),0,(B5-D5))
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Fantastic MD thank you.

    *** Just realised that I have cross posted - not intentionally but each time I tried on here I was getting a message that the server was busy so I tried elsewhere ***

    Please accdept my apologies and my thanks
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Quote Originally Posted by Hoopsah
    Please accept my apologies and my thanks
    We'll let it go this time!
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •