+ Reply to Thread
Results 1 to 5 of 5

Empty Cell has value greater than 1. Why?

  1. #1
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    100

    Empty Cell has value greater than 1. Why?

    I have a spreadsheet called "Schedule Line 1", with a list of items that go from row 6 to 35. These rows have all formula. Some have values like 2436, 2440, etc and others they look empty, because the formula is zero, therefore, no value displayed. On a sheet within that workbook I created a formula to display these values. (eg.: =IF('Schedule Line 1'!AF9="","",'Schedule Line 1'!AF9). So it looks like this:

    2369
    2437
    2440



    2447
    2422
    etc...

    Everything works fine.

    Then, I copy these values into a different workbook and do paste special values with VBA.
    I assume the blank cells between 2440 and 2447 must have values of zero, but they're not. I created a formula like =if(T24>0,1,0) and it returns 1. T24 is a blank spot between 2440 and 2447.

    Any ideas why? How can I overcome this problem.

  2. #2
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Empty Cell has value greater than 1. Why?

    Hi,

    perhaps =if(OR(T24>0,T24<>""),1,0) should do the trick
    Liked the answer given? click * to say so

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Empty Cell has value greater than 1. Why?

    Empty cells and blank cells with zero strings are not the same. Cells with formula which return zero strings are not blanks, hence your formula returns true, which has a value of 1.
    =if(T24>0,1,0)

    Change it

    to
    =if(T24<>"",1,0)

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,626

    Re: Empty Cell has value greater than 1. Why?

    Blank cells are considered as null strings. When XL makes a comparison it first compares the cell content type evaluating =type(a1). If A1 is text TYPE returns 1, for numbers it returns 0. A string ( even a null string) is thus larger than any number.
    If you check the syntax of TYPE you'll see it returns other values for errors, etc..

  5. #5
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    100

    Re: Empty Cell has value greater than 1. Why?

    Thank you!

+ 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. MACRO to empty a range of cells based on whether specified cell is empty
    By TBJV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 10:35 PM
  2. [SOLVED] still have empty cell after run Delete empty cells code
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-25-2012, 04:28 PM
  3. [SOLVED] Making reference to an empty cell display empty rather than zero
    By John007 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-12-2012, 11:13 AM
  4. Replies: 4
    Last Post: 08-25-2009, 06:39 AM
  5. Replies: 3
    Last Post: 04-21-2005, 05:38 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