+ Reply to Thread
Results 1 to 11 of 11

Get rid of #N/A

  1. #1
    Registered User
    Join Date
    01-13-2012
    Location
    ipswich
    MS-Off Ver
    Excel 2003
    Posts
    5

    Get rid of #N/A

    I've created a simple invoice worksheet which looks up prices of items from another worksheet.
    I've copied and pasted the VLOOKUP formula into column H in worksheet1 which looks up the price of an item in a table created in worksheet2 when I enter the item name in column A of worksheet1.

    This works perfectly when there's a value (item) typed into column A (worksheet1). However if there is no value in column A column H returns an error #N/A.

    What I want is for the cell in column H to remain empty(blank) if the relative cell in Column A is empty(blank) without having to remove the embedded formula.

    i.e. if cell A1 contains a product name (value) column H1 should look up and return the price from the table in worksheet2, which it does just fine.

    but if cell A2 is empty I want cell H2 to also remain empty and not return #N/A.

    Is there a workround for this.

    here's my formula in column H

    =VLOOKUP(A17,Sheet2!$A$2:$B$22,2,FALSE)


    Thanks
    Last edited by ipswichtaxis; 01-13-2012 at 11:06 PM.

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: How do you get rid of #N/A

    One way is check first If A17 is in Sheet2!A2:A22 or not, if yes return VLOOKUP otherwise ""

    =IF(COUNTIF(Sheet2!$A$2:$A$22,A17),VLOOKUP(A17,Sheet2!$A$2:$B$22,2,FALSE),"")
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: How do you get rid of #N/A

    Try...

    =IF(ISNA(VLOOKUP(A17,Sheet2!$A$2:$B$22,2,FALSE)),"",VLOOKUP(A17,Sheet2!$A$2:$B$22,2,FALSE))
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    01-13-2012
    Location
    ipswich
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How do you get rid of #N/A

    Thanks Guys both solutions solved the problem

  5. #5
    Registered User
    Join Date
    01-13-2012
    Location
    ipswich
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How do you get rid of #N/A

    The original issue is resolved thanks, but it's created a new problem my totals column returns #VALUE! in empty cells.

    Copy of worksheets attached any suggestions?

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: How do you get rid of #N/A

    =IF(N(H15),H15*G15,"")

    copy down.

  7. #7
    Registered User
    Join Date
    01-13-2012
    Location
    ipswich
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How do you get rid of #N/A

    Quote Originally Posted by Haseeb A View Post
    =IF(N(H15),H15*G15,"")

    copy down.
    Tried that it returns 'FALSE' I would like cells to remain blank if there are no values in relating cells.

    Thanks

  8. #8
    Registered User
    Join Date
    09-26-2010
    Location
    A, A
    MS-Off Ver
    Excel 2003
    Posts
    86

    Re: How do you get rid of #N/A

    Try....
    = IF(ISERROR(VLOOKUP(A17,Sheet2!$A$2:$B$22,2,0)),"",VLOOKUP(A17,Sheet2!$A$2:$B$22,2,0)) or

    =IF(ISBLANK(VLOOKUP(A17,Sheet2!$A$2:$B$22,2,0)),"",VLOOKUP(A17,Sheet2!$A$2:$B$22,2,0))

  9. #9
    Registered User
    Join Date
    01-13-2012
    Location
    ipswich
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How do you get rid of #N/A

    Quote Originally Posted by ipswichtaxis View Post
    Tried that it returns 'FALSE' I would like cells to remain blank if there are no values in relating cells.

    Thanks
    Sorry my bad it does work many thanks

  10. #10
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: How do you get rid of #N/A

    See the attached, Also looks like you are on XL2007 or later, so you use IFERROR.

    =IFERROR(your_formula,"")

    will return blank if it is error.
    Attached Files Attached Files

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Get rid of #N/A

    When one problem is solved, mark it "Solved" then ask further questions in a new thread
    Hope that helps.

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

    Free DataBaseForm example

+ 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