+ Reply to Thread
Results 1 to 6 of 6

Vlookup if range of cells greater than 0 display blank

  1. #1
    Registered User
    Join Date
    10-06-2011
    Location
    Edinburgh, scotand
    MS-Off Ver
    Office 365
    Posts
    6

    Vlookup if range of cells greater than 0 display blank

    Hi guys

    I have made a spreadsheet that essentially works out.

    The 1 st Column A is the ID
    The 2nd Column B is the Contact name
    The 3rd Column C is the Amount.


    Sheet Name: Main Report

    In the 2nd column I have this formulae:

    =VLOOKUP(A2,'ContactRate'!A:B,2,0)

    This work fine.

    |Id |Contact |Amount|
    ------|---------------------|
    6003 |#N/A |0
    ------|---------------------|
    6004 |Email |0
    ----------------------------|
    6008 |#N/A |0
    ----------------------------|
    6009 |#N/A |34.34
    ----------------------------|
    6010 |#N/A |0
    ----------------------------|
    6011 |#N/A |0
    ----------------------------|


    Sheet Name: Contact
    |Id |Contact |
    ------|------------
    6001 |Outgoing |
    ------|------------
    6004 |Email |
    -------------------
    6005|Outgoing |
    -------------------
    6008 |Outgoing |
    -------------------
    6014 |Outgoing |
    -------------------
    6013 | Outgoing |



    However, the spreadsheet has about 100 entries all the cells in column B are showing "#N/A" because there are no values for them to work with.


    This for some reason doesn't work with VLOOKUP. Not the way I am using it anyway

    =IF(C2 >0,"=VLOOKUP(A2,'Contact'!A:B,2,0)

    Can anyone shine any light on this and let me know where I am going wrong?

    I don't like seeing this and normally will use the "IF" function to say that if column C are greater than 0 then show Blank instead of #N/A in Column B. In Theory ID 6009 Column B should be Blank

    output
    Sheet Name: Main Report

    |Id |Contact |Amount|
    ------|---------------------|
    6003 |#N/A |0
    ------|---------------------|
    6004 |Email |0
    ----------------------------|
    6008 |#N/A |0
    ----------------------------|
    6009 | Blank |34.34
    ----------------------------|
    6010 |#N/A |0
    ----------------------------|
    6011 |#N/A |0
    ----------------------------|


    Many Thanks
    AD
    Last edited by adcz250; 03-22-2021 at 08:01 AM.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Vlookup if range of cells greater than 0 display blank

    if you are returning errors (#N/A) you can put an iferror on the formula, like...
    =IFERROR(VLOOKUP(A2,'Contact'!A:B,2,0),"")
    your syntax was wrong in the =IF(C2 >0,"=VLOOKUP(A2,'Contact'!A:B,2,0)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    10-06-2011
    Location
    Edinburgh, scotand
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Vlookup if range of cells greater than 0 display blank

    Thanks Sam, I have if condition along with the Lookup, If Column C is greater than zero display blank or else N/A ("Not Applicable")
    Last edited by adcz250; 03-22-2021 at 08:29 AM.

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Vlookup if range of cells greater than 0 display blank

    I'm guessing because I cannot really tell what you have and what you want and where the issue is. So as I noted, if this is your formula

    =IF(C2 >0,"=VLOOKUP(A2,'Contact'!A:B,2,0)
    the syntax in this is wrong, and usually with an IF/THEN statement you have a "what happens if the condition isn't satisfied" statement. IF(this condition exists do this, otherwise do that)

    maybe you want this? =IF(C2 >0,"",VLOOKUP(A2,'Contact'!A:B,2,0)
    or this... =IF(C2 >0,VLOOKUP(A2,'Contact'!A:B,2,0),"")

  5. #5
    Registered User
    Join Date
    10-06-2011
    Location
    Edinburgh, scotand
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Vlookup if range of cells greater than 0 display blank

    Thanks Sam =IF(C2 >0,"",VLOOKUP(A2,'Contact'!A:B,2,0) worked ... :-)

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Vlookup if range of cells greater than 0 display blank

    Good, glad that worked for you, AND thank you for the rep!

+ 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] find value which is greater than in a range of cells and return the greater value
    By green369 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-11-2015, 02:46 AM
  2. [SOLVED] vlookup if range of cells greater than 0
    By Marvlin in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-04-2014, 01:59 AM
  3. Replies: 1
    Last Post: 09-04-2013, 07:23 AM
  4. Replies: 3
    Last Post: 03-22-2013, 09:02 AM
  5. How to display specific cells ranges with values greater than 0 on a separate worksheet
    By studentofthegame in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2012, 04:25 PM
  6. Replies: 0
    Last Post: 10-08-2012, 05:53 PM
  7. Replies: 3
    Last Post: 09-29-2010, 01:30 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