+ Reply to Thread
Results 1 to 19 of 19

Suppress #NA errors for a cleaner look

  1. #1
    Registered User
    Join Date
    11-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    23

    Suppress #NA errors for a cleaner look

    I've got a fairly simple sheet that uses drop-down boxes to select items to order, and cells that do a VLOOKUP later on to calculate price. By default, there is nothing in the input cells, thus the calculated price cells are normally displaying #NA, until the items are selected. I would like to suppress the #NA warning to give it a cleaner look.

    The first formula resulting in a #NA result is: =VLOOKUP(F6,Y6:Z9,2,FALSE) + 12.5
    The second is: =IF(E6="Y",W6,G6).
    (wherein E6 and F6 are drop-down list entries).

    Thanks in advance.

  2. #2
    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,938

    Re: Suppress #NA errors for a cleaner look

    Try wrapping your formula in IFERROR()
    =IFERROR(your-formula)
    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

  3. #3
    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,938

    Re: Suppress #NA errors for a cleaner look

    OR, just test to see if the input cell is empty...
    =IF(inputcell="","",formula)

  4. #4
    Registered User
    Join Date
    11-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Suppress #NA errors for a cleaner look

    The second one got it; the first just blanked the result regardless of the input. Thanks!

    EDIT: No such luck. It looked good but broke the minute I tried to input a real value.
    This is what I tried: =IF(F6="","",(VLOOKUP(H6,AA6:AB9,2,FALSE) + 12.5))

    It blanks the result cell if there is nothing in the drop-down input (as I want it to), but if there's an actual valid input it doesn't work.
    Last edited by PeterNJ; 05-06-2016 at 11:19 AM.

  5. #5
    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,938

    Re: Suppress #NA errors for a cleaner look

    hmm the IFERROR will only activate if there is an error, so there must have been an error to begin with?

    Anyway, Im happy you got this resolved

  6. #6
    Registered User
    Join Date
    11-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Suppress #NA errors for a cleaner look

    Quote Originally Posted by FDibbins View Post
    hmm the IFERROR will only activate if there is an error, so there must have been an error to begin with?
    Anyway, Im happy you got this resolved
    See above. I thought it was working but no joy.
    The #NA error values are just there because a row is empty (no customer orders yet). Once a customer orders something the cells validate and all is good. I'm just trying to suppress the #NA on all the blank lines. Columns G and H here: http://bit.ly/1Tqhqhn

  7. #7
    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,938

    Re: Suppress #NA errors for a cleaner look

    Please upload your file to the forum. Not all members are able - or willing - to access file-hosting sites

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  8. #8
    Registered User
    Join Date
    11-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Suppress #NA errors for a cleaner look

    That link was a Google docs link. I think I've attached the sheet per your instructions. This is all "101-level" stuff, but I'm a very inexperienced Excel user.
    Attached Files Attached Files

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Suppress #NA errors for a cleaner look

    Using your example worksheet, test for contents in column A. If the cell in column A is blank, the formula returns a blank cell. You could use any other column that could have a blank cell like column D. Either would work.
    Try this in G2 and fill down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    A
    B
    C
    D
    E
    F
    G
    H
    1
    CALL
    NAME
    City/State
    QTY
    New member Y/N
    Fastener Type (use arrow for dropdown list)
    Badge Cost
    Your Cost (including fastener)
    2
    KD2FSH
    Gerald
    Fairfield, NJ
    1
    Y
    Magnetic (add $2.50)
    $15.00
    $0.00
    3
    K2AZ
    John
    Seattle, WA
    1
    N
    Magnetic (add $2.50)
    $15.00
    $15.00
    4
    AA2NI
    Niko
    Tenafly, NJ
    1
    N
    Magnetic (add $2.50)
    $15.00
    $15.00
    5
    KF2TI
    Steven
    Landing, NJ
    1
    N
    Magnetic (add $2.50)
    $15.00
    $15.00
    6
    7
    8
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  10. #10
    Registered User
    Join Date
    11-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Suppress #NA errors for a cleaner look

    Nope, it's still returning an error once valid data is in place. I tried a new entry on line 6. From the moment any data is present in A6 the #NA errors return to G6 and H6, and don't change regardless of whether valid info exists in E and F.

    =IF(A6="","",VLOOKUP(F6,Y6:Z9,2,FALSE)+12.5*D6)

  11. #11
    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: Suppress #NA errors for a cleaner look

    Maybe this?
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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

  12. #12
    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,938

    Re: Suppress #NA errors for a cleaner look

    try this...
    =IF($F6="","",VLOOKUP(F6,Y6:Z9,2,FALSE)+12.5)

  13. #13
    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,938

    Re: Suppress #NA errors for a cleaner look

    Just tried AlKey's suggestion, and that worked too (as it should have)
    =IF($A6="","",VLOOKUP(F6,Y6:Z9,2,FALSE)+12.5)

    Also, you need to absolute that range so it doesnt change...
    =IF(F2="","",VLOOKUP(F2,$Y$2:$Z$5,2,FALSE)+12.5*D2)

  14. #14
    Registered User
    Join Date
    11-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Suppress #NA errors for a cleaner look

    No, none of this is working; something on the sheet is now broken because for any value used in column D there is nothing resulting in columns G or H.

    The result for column G is to take the sum of $12.50 added to the extra costs from column F, depending on what the user selects. Column H is dependent upon column E's result (new members can have one free badge but must pay for the others).

    EDIT: I like the idea of making column A the conditional for display/no-display, but anything before the VLOOKUP seems to break the entire formula.
    Last edited by PeterNJ; 05-06-2016 at 12:02 PM.

  15. #15
    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,938

    Re: Suppress #NA errors for a cleaner look

    Here is your file with the suggested changes made
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    11-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Suppress #NA errors for a cleaner look

    OK, that got it. Everything's perfect now--THANKS.

  17. #17
    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,938

    Re: Suppress #NA errors for a cleaner look

    Good stuff, happy to help and thanks for the feedback

    Out of interest, what was happening that the suggestions did not work?

  18. #18
    Registered User
    Join Date
    11-21-2011
    Location
    NJ
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Suppress #NA errors for a cleaner look

    I wish I knew, to be honest. I think it was the need to put in absolutes in (hidden) Column W to go along with the other stuff, but I'm just not sure. I did tweak it so that column A is the display/no-display test, not column F, and it's all good. I'magonna leave well enough alone at this point

  19. #19
    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,938

    Re: Suppress #NA errors for a cleaner look

    haha ok, I hear you. Happy you got it resolved

+ 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. Code cleaner
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2016, 11:59 AM
  2. [SOLVED] Could this be cleaner?
    By PitBoo in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-13-2015, 11:24 AM
  3. Cleaner Way to write this code
    By zplugger in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2015, 08:04 AM
  4. [SOLVED] Cleaner code
    By madhatter40 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2013, 03:33 PM
  5. [SOLVED] cleaner code
    By scancool in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-14-2012, 04:07 PM
  6. Looking for a cleaner macro
    By CNE5x in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-11-2012, 12:09 PM
  7. Suppress database errors
    By greenfalcon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2005, 07:08 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