+ Reply to Thread
Results 1 to 3 of 3

how to fix IFERROR(VLOOKUP) That returns "0" when reference cell is empty

Hybrid View

fluffyvampirekitten how to fix IFERROR(VLOOKUP)... 08-05-2015, 03:54 AM
TMS Re: how to fix... 08-05-2015, 04:39 AM
fluffyvampirekitten Re: how to fix... 08-10-2015, 10:56 PM
  1. #1
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    how to fix IFERROR(VLOOKUP) That returns "0" when reference cell is empty

    The SAPUSERMASTER data is dynamic .

    When the reference cell is empty , it will return "0" instead of "NOT INDICATED"

    Any idea?


    'Vlookup User Name and User Dept from the SAPUSERMASTER file
        'User Name
        Range("P3").FormulaR1C1 = "=IF(C[-3]="""","""",IFERROR(VLOOKUP(C[-3],[SAPUSERMASTER.xlsx]SAPUSERMASTER!R1C1:R1048576C2,2,0),""NOT INDICATED""))"
            
         
            
        'User Dept
        Range("Q3").FormulaR1C1 = "=IF(C[-4]="""","""",IFERROR(VLOOKUP(C[-4],[SAPUSERMASTER.xlsx]SAPUSERMASTER!R1C1:R1048576C3,3,0),""NOT INDICATED""))"

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,121

    Re: how to fix IFERROR(VLOOKUP) That returns "0" when reference cell is empty

    Personally, I'd change it to this:

    'Vlookup User Name and User Dept from the SAPUSERMASTER file
    'User Name
    Range("P3").FormulaR1C1 = "=IF(RC[-3]="""","""",IFERROR(VLOOKUP(RC[-3],[SAPUSERMASTER.xlsx]SAPUSERMASTER!R1C1:R1048576C2,2,0),""NOT INDICATED""))"
    'User Dept
    Range("Q3").FormulaR1C1 = "=IF(RC[-4]="""","""",IFERROR(VLOOKUP(RC[-4],[SAPUSERMASTER.xlsx]SAPUSERMASTER!R1C1:R1048576C3,3,0),""NOT INDICATED""))"

    But, without both workbooks, I can't test whether or not it works.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-01-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    66

    Re: how to fix IFERROR(VLOOKUP) That returns "0" when reference cell is empty

    I managed to fix it ! Thanks for the help ^^

+ 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. Replies: 6
    Last Post: 04-14-2014, 04:30 PM
  2. [SOLVED] Index function returns 0 (zero) instead of ""(empty)
    By deekshitulu in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-16-2014, 06:52 AM
  3. [SOLVED] "IF" to "IFERROR" (or other formula) help by skipping empty cells
    By slack578 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-10-2013, 03:50 PM
  4. [SOLVED] IFERROR Returns 0 instead of "N/A"
    By trizzo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-08-2013, 11:12 AM
  5. [SOLVED] IFERROR(VLOOKUP) That returns "0" when reference cell is empty
    By Sam Capricci in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-04-2013, 01:16 AM
  6. [SOLVED] IFERROR still returns #VALUE, Needs to be "" or 0
    By BeachRock in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-22-2012, 03:00 PM
  7. For Each Next returns "Empty" when Data in Cell
    By Matt Roberts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2005, 10:20 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