+ Reply to Thread
Results 1 to 7 of 7

How to make IFERROR and VLOOKUP functions skip blank cells when searching multiple sheets

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    3

    How to make IFERROR and VLOOKUP functions skip blank cells when searching multiple sheets

    I am trying to combine multiple data sets with information on organizational members. The unique identifier I am using is email address. Each email address may appear on multiple sheets and may have different data available in different sheets. There are 7 sheets I am working with.

    I am using this formula:

    =IFERROR(VLOOKUP(A113,sheet1,11,FALSE),IFERROR(VLOOKUP(A113,sheet2,13,FALSE),IFERROR(VLOOKUP(A113,sheet3,13,FALSE),IFERROR(VLOOKUP(A113,sheet4,13,FALSE),IFERROR(VLOOKUP(A113,sheet5,13,FALSE),IFERROR(VLOOKUP(A113,sheet6,13,FALSE)," "))))))

    My understanding of this function as it is written is that excel will look in each of these sheets for the email address in row A113 and will return the value in column 11 (in this case, first name) if the email address is found. So it will look in sheet1, then sheet2, then sheet3, then sheet4, then sheet5, then sheet 6.

    The problem I have encountered is when there is a blank value in a sheet that the lookup takes that value instead of skipping it. For example, the email address in A113 does exist in sheet1; however, column 11 (first name) is blank for that row. The formula returns "0." But I know that the email address in A113 also exists in sheet4 and DOES have a value for the "first name" column. Since the formula already found the address in sheet1 though it returns that value even though it is blank.

    Is there a way to make this formula work how it is and skip any blank cells? Or is there another way to accomplish this?

    Thank you!

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: How to make IFERROR and VLOOKUP functions skip blank cells when searching multiple she

    What are the differences between the seven sheets? I am wondering if the data on all 7 sheets is the same type of data, why not consolidate into one sheet?

    Also I don't know if this is intentional or not but the col_index_num in your VLOOKUPS varies from 11 on the sheet1 to 13 on sheets 2 3 4 5 and 6. I would also recommend that you use "" instead of " " for the final statement in your formula, so it leaves the cell blank instead of placing a single space.
    Last edited by Speshul; 07-10-2014 at 12:20 PM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  3. #3
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: How to make IFERROR and VLOOKUP functions skip blank cells when searching multiple she

    Hi ,

    Update sample workbook without confidential data it will be help full to understand quickly and for fast request .

    Punnam

  4. #4
    Registered User
    Join Date
    07-10-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    3

    Re: How to make IFERROR and VLOOKUP functions skip blank cells when searching multiple she

    The 7 sheets each have different pieces of data. Some have the same columns, but others have extra. Also, since each sheet may have the same email addresses I would end up with duplicates in one sheet if I combined them all and I wasn't sure how VLOOKUP would handle that. I did combine 3 sheets that had all the same data columns, so there are not as many as I started with. Combining all 7 sheets would be a lot of work and I think would negate the use of the nested vlookup that I thought could solved this problem for me.

    There are differing col_index_num in my VLOOKUPS because the column number for certain data points is not always the same for each sheet. Several I did make into the same formatting, but not all of them.

    Thanks for your response and for the suggestion on taking out the space at the end.

    I have attached a sample workbook and took out all the data except for one that can serve as an example. I changed the email address to AB12.

    The sheet "Email Master List" is where I am entering all the VLOOKUP formulas to combine the data from the other 8 sheets. The data piece I'm using for the example is "Region." The formula in B4 of Email Master List is attempting to lookup the region for member AB12 from within several sheets (1,2,3,4,5,6). I excluded some sheets because I knew they don't have any data for Region.

    In this example AB12 is found by VLOOKUP in sheet1, but the cell is empty. I'm assuming this is why the result is "0" but I'm not sure. AB12 does exist with data in the region cell in sheet4, sheet5, and sheet6.

    I experimented with the formula by taking out the sheet3, sheet2, and sheet1 lookups. When I removed sheet 2 or 3 from the formula the result was still 0. When I removed sheet 1 from the formula the result was "central." This is how I came to the conclusion that the problem is because of the empty cell in sheet 1.

    I hope this helps make my problem more clear and I appreciate any help you can offer!
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: How to make IFERROR and VLOOKUP functions skip blank cells when searching multiple she

    Your Named Ranges on this sample sheet are not set up correctly, several are showing as #REF and others are not referencing the whole data set, for example, sheet6 range is "='6'!$A$2:$AJ$2", which is only showing one row.

    The formula you have on the Email Master List sheet is returning a zero because it finds that value on the first tab (1).

    I would advise consolidating all of this data into one large sheet if possible, removing duplicates from the Email address as this is unique. If there are shared columns between these sheets, such as address, which are populated in some sheets but not others for a given Unique Email Address, the data consistency will be an issue for writing formulas to extract. As far as I can tell the formula to do this would be horrible, something like the below method I tried, but it's not working

    (it's one formula, broken up so I could ATTTEMPT to follow it...didn't help)
    Please Login or Register  to view this content.
    Last edited by Speshul; 07-10-2014 at 02:31 PM.

  6. #6
    Registered User
    Join Date
    07-10-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    3

    Re: How to make IFERROR and VLOOKUP functions skip blank cells when searching multiple she

    Thanks Speshul for your help. I guess it may not be the best approach I am taking. I think I will rethink this. I will combine all the sheets as you have suggested. I will only combine the columns that are common to all the sheets and then use VLOOKUP to fill in the data that is unique to each sheet.

    I now have a new problem though because of the duplicate records among all the sheets. When I combine them I need a way to get rid of duplicate rows while still keeping the data from each instance of a record.

    For example:
    There are 2 instances of [email protected]
    the first row has his address, phone number and zip code
    the second row has his region and birthday

    How can I delete the duplicate row but still keep all the data on John Doe?

    I would do this by hand, but I have over 1500 unique records and many more if you count all the duplicates, so it would be astronomical to do that all by hand.

    Does anyone know how to do this or have other suggestions? I wonder if I should start a new thread on this question?

  7. #7
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: How to make IFERROR and VLOOKUP functions skip blank cells when searching multiple she

    I would advise starting a new thread as this is a new question, you will get better responses and people who can answer it are more likely to take a look. You can link back to this original thread as you have posted information on what you are trying to achieve as well.

    I may be able to take a look tomorrow, but I will be signing off here in the next few minutes. Good luck and I hope you find a solution!

+ 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] Combine multiple cells text into one cell, skip blank cells.
    By T15K in forum Excel General
    Replies: 6
    Last Post: 12-05-2014, 09:49 PM
  2. [SOLVED] How to make Excel VBA to skip blank cells until a cell has a number
    By vnzerem in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2013, 08:29 PM
  3. Excel 2007 : skip blank cells in vlookup
    By jrable in forum Excel General
    Replies: 9
    Last Post: 03-22-2011, 08:57 PM
  4. Userform skip blank cells while searching for duplicate entries
    By hey1000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2010, 08:47 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