+ Reply to Thread
Results 1 to 4 of 4

Thread: Hide/eliminate #Value error

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    9

    Hide/eliminate #Value error

    Hi, I am doing a simple subtraction, i.e. =E21-G21.

    I am subtracting two Vlookup vormulas that looks like this

    
    =IF(COUNTIF($I$1:$I$83,"IC Prov   ")=0,"",INDEX($W$1:$W$83,SMALL(IF($I$1:$I$83="IC Prov   ",ROW($I$1:$I$83)-ROW($I$1)+1),MIN(2,COUNTIF($I$1:$I$83,"IC Prov   ")))))
    
    &
    
    =IF(COUNTIF($I$1:$I$83,"IC Prov   ")=0,"",INDEX($W$1:$W$83,SMALL(IF($I$1:$I$83="IC Prov   ",ROW($I$1:$I$83)-ROW($I$1)+1),MIN(1,COUNTIF($I$1:$I$83,"IC Prov   ")))))
    I am getting a #Value error if they both return a value = "".

    How do I fix it? the IF() command does not work here.
    Last edited by sonar123; 03-06-2011 at 06:38 AM.

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Hide/eliminate #Value error

    Validate both contain numbers prior to coercing

    =IF(COUNT(E21,G21)<2,"n/a",E21-G21)
    or, given use of XL2007

    =IFERROR(E21-G21,"n/a")
    modify n/a per preference

    (obviously in your OP the formulae are identical...ie result of subtraction would only ever be #VALUE! or 0)

  3. #3
    Forum Guru Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    2,706

    Re: Hide/eliminate #Value error

    In Excel 2007 you can use the IFERROR() function


    =IFERROR(E21-G21,"")


    PS - say Hi to my sister down there!

  4. #4
    Registered User
    Join Date
    03-05-2011
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    9

    Smile Re: Hide/eliminate #Value error

    You guys really know your stuff.
    Thanks a mill.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0