+ Reply to Thread
Results 1 to 7 of 7

Vlookup & IF formula needed

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-01-2014
    Location
    London, England
    MS-Off Ver
    Mac 2016
    Posts
    108

    Vlookup & IF formula needed

    Hi

    I am doing some vlookups but when a cell is blank it displays a '0'. I tried adding iferror with ,"" but this did not work. The data being looked up is text and numbers.

    I have attached an example. On the 'Output' sheet I need the boxes in red to be blank.

    Any ideas?

    Thanks
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-19-2016
    Location
    England
    MS-Off Ver
    2010 and 2013
    Posts
    17

    Re: Vlookup & IF formula needed

    Try this =IF(VLOOKUP(A10,Data!A:C,3,FALSE)=0,"",VLOOKUP(A10,Data!A:C,3,FALSE))

    There's probably an easier way but this works also. It's saying if your Vlookup returns zero then return blank.

    Or

    =SUBSTITUTE(VLOOKUP(A10,Data!A:C,3,0),0,"")

    Or

    =""&VLOOKUP(A3,Data!A:C,3,0)
    Last edited by ExcelsBiggestFan; 03-19-2016 at 01:23 PM.

  3. #3
    Forum Contributor
    Join Date
    11-01-2014
    Location
    London, England
    MS-Off Ver
    Mac 2016
    Posts
    108

    Re: Vlookup & IF formula needed

    Thanks Hercules1946, this is a fast fix. :-)

  4. #4
    Forum Contributor
    Join Date
    09-24-2012
    Location
    York, England
    MS-Off Ver
    Excel 2003/07/10
    Posts
    165

    Re: Vlookup & IF formula needed

    This occurs when VLOOKUP doesn't find a match, which is not an error situation. I normally handle this by formatting all the cells that contain VLOOKUPs to suppress zeros. This is similar to the global suppression of zero in the Excel options, but it works better if there are parts of your workbook where you need a zero showing.
    Highlight the cells that you want to suppress zeros, and create a custom format as follows:

    Right Click within the selected cells and Select Format Cells/Custom.
    In the Custom Window that opens, erase the Type box contents and replace with:

    0;-0;;@

    Click OK.

  5. #5
    Forum Contributor
    Join Date
    11-01-2014
    Location
    London, England
    MS-Off Ver
    Mac 2016
    Posts
    108

    Re: Vlookup & IF formula needed

    That works, thank you ExcelsBiggestFan :-)

  6. #6
    Forum Contributor
    Join Date
    09-24-2012
    Location
    York, England
    MS-Off Ver
    Excel 2003/07/10
    Posts
    165

    Re: Vlookup & IF formula needed

    Its worth noting the custom format, because Excel does this in a number of situations, and in some cases duplicating the entire formula can be a pain, and with a large amount of data it could slow down your processing. With your particular formula, its OK.

    Glad to Help

  7. #7
    Registered User
    Join Date
    03-19-2016
    Location
    England
    MS-Off Ver
    2010 and 2013
    Posts
    17

    Re: Vlookup & IF formula needed

    Welcome, but I think Hercules is the best response for this. My formula suggestions can mean slow processing if you've got a lot of data.

+ 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. If and vlookup formula help needed
    By kbaz555 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-07-2016, 12:25 PM
  2. vlookup formula tweak needed
    By 10 Dollar Bill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-05-2015, 01:32 PM
  3. VLOOKUP / IF formula needed
    By SwiftandSure in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2014, 09:50 AM
  4. [Help Needed] vlookup formula
    By tomsheng in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-18-2013, 11:39 PM
  5. VLookUp - If & And Formula *Help Needed*
    By Jonesey_MFC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-02-2012, 12:21 PM
  6. vlookup needed - or And if formula
    By brendanolear in forum Excel General
    Replies: 3
    Last Post: 02-27-2007, 09:33 AM
  7. Vlookup Formula Needed, Help Please
    By curly88 in forum Excel General
    Replies: 2
    Last Post: 09-28-2006, 04:10 AM

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