+ Reply to Thread
Results 1 to 5 of 5

Prevent #VALUE error

  1. #1
    Registered User
    Join Date
    09-05-2005
    Location
    Basingstoke, England
    MS-Off Ver
    2003
    Posts
    86

    Prevent #VALUE error

    I have tried but ultimately failed at trying to prevent the #VALUE error because cells contain no values. How can I have a cell contain a zero value so enabling a sum?

    This is my formula for the value to be entered in the cell immediately above;
    This is in C10, =IF(C9<>"",HLOOKUP(C9,KPI!$C$5:$F$6,2),"") Obviously if no data has been entered it throws up the #VALUE error but how can I have the cell with the formula in return a zero value prior to data entry in the cell above?

    I do hope that makes sense, thank you in advance.

    Duca

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You can use ISERROR, but if there are many of such formulas it can slow calculation. Alternatively use Conditional Formatting to hide the error, see

    http://www.excel-it.com/excel_condit...formatting.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-05-2005
    Location
    Basingstoke, England
    MS-Off Ver
    2003
    Posts
    86
    Thank you Roy but due to my lack or experience I was failing to type the correct formula. I do have the formula for counting all of the returned values in which the error is getting returned;
    =SUMPRODUCT((MOD(ROW(C9:C112),2)=0)*(C9:C112))

    If I could replace it with a formula that counts every other cell (I need all even cells counted from C10 to C112 inclusive) and ignore blanks, that too would benefit me. Is that an easier solution?

    Thank you.

    Duca

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by Ducatisto
    =SUMPRODUCT((MOD(ROW(C9:C112),2)=0)*(C9:C112))
    Hello Duca,

    If C9, or any other cell in C9:C112, contains a "formula blank" [i.e. "" returned by a formula] then your SUMPRODUCT formula will give an error, change it to this:

    =SUMPRODUCT((MOD(ROW(C9:C112),2)=0)+0,C9:C112)

    Note: although that formula should work, it isn't very robust. If you add a row at the top of the worksheet it'll give the wrong result, I'd advise you to further change to

    =SUMPRODUCT((MOD(ROW(C9:C112)-ROW(C9)+1,2)=0)+0,C9:C112)
    Last edited by daddylonglegs; 02-27-2008 at 09:28 AM.

  5. #5
    Registered User
    Join Date
    09-05-2005
    Location
    Basingstoke, England
    MS-Off Ver
    2003
    Posts
    86
    Thank you, in the meantime I realised my error in the formula in my first post

    =IF(C9<>"",HLOOKUP(C9,KPI!$C$5:$F$6,2),"")

    It should have been this;

    =IF(C9<>"0",HLOOKUP(C9,KPI!$C$5:$F$6,2),"0") I had missed out the zero's, doh!

    In your mind, do you think it would be quicker and more efficient either way or would I not notice any performance hit?

    Thank you all for your help.

    Duca

+ 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