+ Reply to Thread
Results 1 to 6 of 6

Selectively reference a cell range, but not include the cells containing error code text

  1. #1
    Registered User
    Join Date
    08-05-2016
    Location
    Manchester
    MS-Off Ver
    2010
    Posts
    18

    Unhappy Selectively reference a cell range, but not include the cells containing error code text

    Hi,

    Please can someone help me with this issue, I am stumped.

    See attached excel containing a sample of data to help explain my point.

    The formulas in column D and E are not working because column C contains data that gives a completely legitimate #DIV/0! error in column D. Because of this error, column E cannot complete the percentrank formula, as #DIV/0! Is not a number, obviously.

    How can I make the percentrank formula in column E ignores the cells with #DIV/0! errors in column D? i.e. how can I make it reference D2:D11 AND D13:15 AND D17:19, but not D12 or D16? Note, the actual dataset is much bigger, so I cannot just manually edit the percentrank reference area.

    Imaginary pennies (but infinite thanks) for your thoughts.

    EDIT:
    Sorry, I should have said in the original message that I have already tried AlKey's suggestion - "Replace you formula in D2 with: =IFERROR(100*(B2/C2),0)". It works to fix the formulas; however, the percentrank needs to not include those '0s', because if it does, the '0s' trick the percentrank into thinking the dataset is bigger than it is, which effects the final column E calculations. Basically, the numbers in column E are different if I do or do not include '0s' in column D.
    Last edited by Zdog; 11-07-2017 at 10:48 AM. Reason: clarification of problem

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Selectively reference a cell range, but not include the cells containing error code te

    Replace you formula in D2 with: =IFERROR(100*(B2/C2),0)
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    08-05-2016
    Location
    Manchester
    MS-Off Ver
    2010
    Posts
    18

    Re: Selectively reference a cell range, but not include the cells containing error code te

    Hi AlKey,

    Sorry, I should have said in the original message that I have already tried that. It works to fix the formulas; however, the percentrank needs to not include those '0s', because if it does, the '0s' trick the percentrank into thinking the dataset is bigger than it is, which effects the final column E calculations. Basically, the numbers in column E are different if I do or do not include '0s' in column D.

    I'll edit the original question to highlight that.

    Thanks.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Selectively reference a cell range, but not include the cells containing error code te

    Do you need to replace 0 and errors with blanks?
    Try this:
    in D2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    in E2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-05-2016
    Location
    Manchester
    MS-Off Ver
    2010
    Posts
    18

    Re: Selectively reference a cell range, but not include the cells containing error code te

    Hi AlKey,

    Thanks, that almost fixes things - it gets rid of the error messages. Cant believe I didn't think of using 'blank' - I am tired... I did need to tweak it a bit, because it was also giving blanks for rows 3 and 4, which I want to remain '0'.

    However, these empty cells cause issue in upstream calcs. For example,

    =IF(E2>=0.996,"Y","N") should only say 'Y' for greater than 0.996 (99.6%). However, it now also gives a 'Y' for the blank cells.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Selectively reference a cell range, but not include the cells containing error code te

    What if in D2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Column E returns 0s where there are 0s in column C.

    All
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    return "N" except 'Country' 5 (row 6).

    What am I missing?
    Dave

+ 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. [SOLVED] Countif code that counts cells based on text string specified in a reference cell
    By john quinn in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-08-2015, 06:30 PM
  2. [SOLVED] How to adapt a code to include a range of cells instead of the whole sheet
    By nje in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2013, 08:52 AM
  3. VBA problem with Print Range code run-time error 1004 text not valid reference
    By Jeep56 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-14-2013, 03:38 PM
  4. How to include cell reference data between text?
    By tylerfoo in forum Excel General
    Replies: 3
    Last Post: 04-27-2011, 04:35 AM
  5. include cell reference in graph text box
    By roland willems in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-03-2008, 04:02 PM
  6. include string or text value in cell reference
    By nelly in forum Excel General
    Replies: 5
    Last Post: 06-06-2006, 07:40 PM
  7. [SOLVED] sum a range of cells that include an error
    By HeatherC in forum Excel General
    Replies: 2
    Last Post: 01-28-2005, 07:06 AM

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.6.0 RC 1