+ Reply to Thread
Results 1 to 11 of 11

(Vlookup)Returning 0 If cell is empty

  1. #1
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    281

    (Vlookup)Returning 0 If cell is empty

    Hi guys, so i am currently using this formula but i am baffled as to why it is returning 0 , if the cell its looking in is blank?

    Please Login or Register  to view this content.
    Thanks.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: (Vlookup)Returning 0 If cell is empty

    It will return 0 if column Q (16th column) is blank.

  3. #3
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    281

    Re: (Vlookup)Returning 0 If cell is empty

    Is there a way to have it return blank?

  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)Returning 0 If cell is empty

    usually vlookup returns a 0 if it finds the lookup item (whatever you have in C6) in your lookup area but there is nothing in the cell across from it.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    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)Returning 0 If cell is empty

    maybe this...
    =IF(C6="","",if(VLOOKUP(C6,INDIRECT("'"&G4&"'!$B$3:$BA$318"),16,FALSE)="","blank",VLOOKUP(C6,INDIRECT("'"&G4&"'!$B$3:$BA$318"),16,FALSE))
    this is untested and I may have the number of parens off so you might have to tweak it a bit.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: (Vlookup)Returning 0 If cell is empty

    No: if you want blank you will have to test for return of 0

    =IF(C6="","",IF(VLOOKUP(C6,INDIRECT("'"&G4&"'!$B$3:$BA$318"),16,FALSE)=0),"",VLOOKUP(C6,INDIRECT("'"&G4&"'!$B$3:$BA$318"),16,FALSE)))

    OR format cells to hide zeros

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: (Vlookup)Returning 0 If cell is empty

    What type of value does the vlookup return when it's resulting cell is NOT empty, Text or Number?

    If it's usually text, try
    =IF(C6="","",T(VLOOKUP(C6,INDIRECT("'"&G4&"'!$B$3:$BA$318"),16,FALSE)))

    If it's a number, try
    =IF(C6="","",IFERROR(1/(1/VLOOKUP(C6,INDIRECT("'"&G4&"'!$B$3:$BA$318"),16,FALSE)),""))


    If it could be either, then you're stuck with the brute force method Sambo posted, if vlookup = "" then "" otherwise vlookup

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: (Vlookup)Returning 0 If cell is empty

    Quote Originally Posted by JohnTopley View Post
    No: if you want blank you will have to test for return of 0
    No, test for "". An actual zero in the cell may be a possibility, and is a real/actual value.

  9. #9
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    281

    Re: (Vlookup)Returning 0 If cell is empty

    That worked, thanks sambo

  10. #10
    Forum Contributor
    Join Date
    05-06-2017
    Location
    London, United Kingdom
    MS-Off Ver
    2016
    Posts
    281

    Re: (Vlookup)Returning 0 If cell is empty

    Yours also worked, jonmo1

  11. #11
    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)Returning 0 If cell is empty

    glad I could help. 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] Returning last non empty cell
    By andoin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-10-2014, 06:33 PM
  2. [SOLVED] returning a empty cell
    By ned 51 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2013, 11:13 AM
  3. [SOLVED] Finding the nth non empty cell in a row and returning value to text box vba
    By jimalya in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-23-2013, 01:41 PM
  4. [SOLVED] Returning a blank cell if the lookup value is empty
    By mgmerv in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2012, 06:59 AM
  5. Replies: 6
    Last Post: 09-16-2010, 05:19 AM
  6. Returning an empty cell instead of a zero
    By Hitch75 in forum Excel General
    Replies: 3
    Last Post: 12-14-2009, 09:34 AM
  7. Empty cell not returning zero
    By Lizabeta in forum Excel General
    Replies: 2
    Last Post: 07-30-2009, 02:15 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