+ Reply to Thread
Results 1 to 10 of 10

using IF(ISBLANK with cells that contain equations returns #VALUE!

  1. #1
    Registered User
    Join Date
    03-23-2011
    Location
    Baltimore, MD
    MS-Off Ver
    Excel 2007
    Posts
    8

    using IF(ISBLANK with cells that contain equations returns #VALUE!

    Hi y'all
    I have a function that I am trying to return a string value given certain conditions. Some of the referenced cells are "blank" so I am using the equation: IF(OR(ISBLANK(CQ2),ISBLANK(EM2)),"",IF(CQ2-EM2=-1,"up",IF(CQ2-EM2=0,"same",IF(CQ2-EM2>0,"down")))). This is returning #VALUE! when one or both of the referenced cells is "blank" but has an equation in it (that also uses ISBLANK logic).

    I can't trim the worksheet of the functions because i'm still using them.

    Any ideas that would resolve this and return a blank cell when one or both reference cells are blank? Is there a different logic command I should use? Have I just screwed up the equation (even though it's the same one that has worked before)

    Appreciated!
    Last edited by osteolass; 05-01-2013 at 03:53 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: using IF(ISBLANK with cells that contain equations returns #VALUE!

    Cells with "" aren't truly blank, so ISBLANK will return FALSE, try just comparing with "" like this

    IF(OR(CQ2="",EM2=""),"",IF(CQ2-EM2=-1,"up",IF(CQ2-EM2=0,"same",IF(CQ2-EM2>0,"down"))))
    Audere est facere

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: using IF(ISBLANK with cells that contain equations returns #VALUE!

    A formula returning "" is NOT Blank...It's a Null Text String.

    Instead of ISBLANK(cell)
    use
    cell=""

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,968

    Re: using IF(ISBLANK with cells that contain equations returns #VALUE!

    IF(OR(CQ2="",EM2=""),"",IF(CQ2-EM2=-1,"up",IF(CQ2-EM2=0,"same",IF(CQ2-EM2>0,"down"))))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    03-23-2011
    Location
    Baltimore, MD
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: using IF(ISBLANK with cells that contain equations returns #VALUE!

    Thanks y'all!

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,968

    Re: using IF(ISBLANK with cells that contain equations returns #VALUE!

    Happy to help. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neet and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: using IF(ISBLANK with cells that contain equations returns #VALUE!

    Another way to write your formula.....

    =IF(COUNT(CQ2,EM2)=2,CHOOSE(SIGN(CQ2-EM2)+2,"up","same","down"),"")

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: using IF(ISBLANK with cells that contain equations returns #VALUE!

    FWIW...

    The ISBLANK function is not correctly named based on what it does.

    It should have been named ISEMPTY.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,968

    Re: using IF(ISBLANK with cells that contain equations returns #VALUE!

    good point Biff, you going to tell MS?
    lol

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: using IF(ISBLANK with cells that contain equations returns #VALUE!

    "Billions and Billions" of people have told MS!

+ 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