+ Reply to Thread
Results 1 to 3 of 3

Stop Vlookup bringing back 0's or #REF! and bring back blanks instead

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2016 Professional Plus
    Posts
    35

    Stop Vlookup bringing back 0's or #REF! and bring back blanks instead

    Evening

    After a full day of trying I've got down to two different formula but i'm having a problem with each one, Option 1 brings back 0's when there is no text in the cell Vlookup is searching, whilst Option 2 solves the 0's but then brings back #REF! when D2 on the "Control Sheet" is blank.

    Just for information the Staff members name that I use in the D column (D2, D3 etc) is only added once a client is allocated, before which it is left blank

    Any ideas how to get Option 1 below to stop showing 0's or how to get Option 2 below to stop showing #REF!

    Option 1

    =IF('Control Sheet'!D2<>"",VLOOKUP(A2,INDIRECT('Control Sheet'!D2&"!$A:$K"),11,0),"")


    Options 2

    =T(VLOOKUP(A2,INDIRECT("'"&'Control Sheet'!D2&"'!A:K"),11,0))
    Last edited by Carling73; 05-30-2013 at 04:40 PM. Reason: Solved

  2. #2
    Registered User
    Join Date
    07-16-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2016 Professional Plus
    Posts
    35

    Re: Stop Vlookup bringing back 0's or #REF! and bring back blanks instead

    Sorted it


    =IF('Control Sheet'!D2="","",T(VLOOKUP(A2,INDIRECT("'"&'Control Sheet'!D2&"'!A:K"),11,0)))

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

    Re: SOLVED - Stop Vlookup bringing back 0's or #REF! and bring back blanks instead

    The definition of the Table array in the VLOOKUP is what is causing the errors. When D2 is blank, the formula jumps to the False part of the If statement which is "". When the statement is TRUE it processes the VLOOKUP which cannot use the array definition that you have given.

    If you could post a workbook with generic data there would be a better chance of finding out exactly what you are trying to do and then provide an answer to you.
    <---------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

+ 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