+ Reply to Thread
Results 1 to 5 of 5

If statement cannot return a real blank space

  1. #1
    Registered User
    Join Date
    09-01-2011
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    78

    If statement cannot return a real blank space

    Hi,

    I have a column of cells with the following formula:

    Cell F7:
    =IF(E7<7*500,7*700-E7,"")
    Basically this is checking if a balance is below 7*500, if it is the cell will return 7*700-E7 (it is filling up an account).

    I then have another column (H) which will add the above corresponding cell to itself, i.e. H7 is
    =NUMBERS+F7
    When my if statement in F7 returns a blank ," ", I get a #VALUE! error in my H7 cell. If I set the blank to be a "0" instead
    =IF(E7<7*500,7*700-E7,"0")
    everything works.

    How can I make the F7 cell treat the blank in the if statement as a 0, without actually having the F column show 0's?

    Thank you!
    Last edited by labogola; 09-01-2011 at 09:21 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: If statement cannot return a real blank space

    You could use =IF(E7<7*500,7*700-E7,0)

    And then format the cell not to display anything for zero values.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  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: If statement cannot return a real blank space

    use =sum(NUMBERS,F7) instead it ignores ""
    "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
    09-01-2011
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: If statement cannot return a real blank space

    Hey, thanks so much Domski and and Martindwilson.

    I've tried sum, but it doesn't work as the cells still returns a #VALUE! error if the IF statement returns a blank "".

    Domski that works, but I'm trying to get the cells blank because they are checked by a script for their values.

  5. #5
    Registered User
    Join Date
    09-01-2011
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: If statement cannot return a real blank space

    Okay I've found a fix:
    =NUMBERS+IF(ISNUMBER(F7),F7,0)

+ 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