+ Reply to Thread
Results 1 to 12 of 12

Formula reads 0 as blank

  1. #1
    Registered User
    Join Date
    01-26-2017
    Location
    Auburn, NY
    MS-Off Ver
    2010
    Posts
    4

    Formula reads 0 as blank

    I'm trying to enter a formula that looks at three columns (A, B, and C) and returns the value in the last non-blank column.
    The formula that I'm using is =if(c1<>"",c1,if(b1<>"",b1,if(a1<>"",a1)))
    This formula works for the most part, except when the latest cell has a value of 0. If C1 is 0, then the formula is viewing it as blank and is returning the value in B1 instead. How do I get it to return 0 if the cell isn't blank?

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Formula reads 0 as blank

    I cannot replicate this behavior. My copy of Excel correctly distinguishes between "" and 0, and returns C1 when C1 contains 0. Can you upload a spreadsheet that exhibits this behavior?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Formula reads 0 as blank

    Please Login or Register  to view this content.
    Try this array formula
    Use CTRL SHIFT ENTER instead of ENTER
    Last edited by popipipo; 01-26-2017 at 11:19 AM.
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Formula reads 0 as blank

    Testing the formula I get it to return the 0, why not attach the sheet, so it can be investigated further

  5. #5
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Formula reads 0 as blank

    I get it to return the 0
    That is what he want

    How do I get it to return 0

  6. #6
    Registered User
    Join Date
    01-26-2017
    Location
    Auburn, NY
    MS-Off Ver
    2010
    Posts
    4

    Re: Formula reads 0 as blank

    Unfortunately, I can't upload the spreadsheet because it contains confidential info on it. I tried to copy it without the confidential info onto a new workbook but now the formula is working correctly for me on the new copy too. It is literally an exact copy. What would cause a formula to not work on one workbook but work properly on another? I've checked my calculation options and it's set to automatic. All of my other formulas are working properly. I'm at a loss...

  7. #7
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Formula reads 0 as blank

    take a look at this simple file
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Formula reads 0 as blank

    I am not sure why it would work correctly in one workbook, and fail to work in another workbook.

    One debugging step you might try is to use the Formula evaluate tool (https://support.office.com/en-us/art...6-a70aa409b8a7 ). This will allow you to step through the formula that isn't working and see what value it pulls up for C1 (which may be different from what is displayed, if cell formatting causes the display to be different from the actual value), which should allow you to see why it is returning FALSE for C1<>"". From this side of the internet, it seems obvious to me that C1 must contain "" or be blank in order for that logic statement to return FALSE, but this tool should allow you to see what it is returning.

  9. #9
    Registered User
    Join Date
    01-26-2017
    Location
    Auburn, NY
    MS-Off Ver
    2010
    Posts
    4

    Re: Formula reads 0 as blank

    I used the evaluate tool and it's returning #N/A instead of 0 for C1. So confused...

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Formula reads 0 as blank

    My next debugging step, then, would be to look very carefully at C1. What is in C1?

  11. #11
    Registered User
    Join Date
    01-26-2017
    Location
    Auburn, NY
    MS-Off Ver
    2010
    Posts
    4

    Re: Formula reads 0 as blank

    Just 0. No formula, no conditional formatting, no blanks.

  12. #12
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Formula reads 0 as blank

    Quote Originally Posted by kfeo View Post
    Unfortunately, I can't upload the spreadsheet because it contains confidential info on it. I tried to copy it without the confidential info onto a new workbook but now the formula is working correctly for me on the new copy too. It is literally an exact copy. What would cause a formula to not work on one workbook but work properly on another? I've checked my calculation options and it's set to automatic. All of my other formulas are working properly. I'm at a loss...
    Hi,

    In that case it seems to me that establishing the problem will only be established by us seeing the actual workbook. Since you managed to get it working merely by copying then the problem seems to be something to do with your confidential data.

    In cases like this I take a binary approach to establishing causation. i.e. Try copying it but with half the confidential data still in place and see what happens. If that's OK then repeat but with the other half of the confidential data which will presumably give you an error. So that tells you that the error is with the last set of copied data.

    So iterate the whole process each time copying half the data you know causes the problem. You'll soon hone it down to a single line.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. How do I blank a row when it reads 0
    By shanni11 in forum Excel General
    Replies: 5
    Last Post: 09-20-2016, 12:58 PM
  2. Excel reads blank cells as matching
    By cnbales in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-29-2016, 03:31 PM
  3. Replies: 3
    Last Post: 03-26-2014, 10:45 AM
  4. Need a formula that reads colors
    By TinaL in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-18-2013, 03:18 PM
  5. Formula reads date as number
    By pete5761 in forum Excel General
    Replies: 1
    Last Post: 12-16-2005, 05:55 PM
  6. Replies: 14
    Last Post: 09-06-2005, 03:05 PM
  7. Replies: 1
    Last Post: 02-21-2005, 01:06 PM

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