+ Reply to Thread
Results 1 to 7 of 7

Lookup & skipping blank rows

  1. #1
    Registered User
    Join Date
    09-05-2016
    Location
    Savannah, Georgia
    MS-Off Ver
    2016
    Posts
    3

    Question Lookup & skipping blank rows

    Hello, first time posting and I think I am in the right spot.

    I am currently working on my Vendor Buying Guide Workbook. We have over 250 items we order weekly and 4 vendors we order from. I am working on creating Sheets for each vendor that have the items we buy from them, which changes frequently as our vendors' prices change often. I have the lookup working fine, with the unit and the pricing.

    The problem is, I cannot figure out a formula to get rid of blank lines. I hope I attach my example Excel sheet correctly. If not, please alert me and on how to do so. Please be sure to look at all three sheets, Items, Vendor1 and Vendor2.

    Thanks again for the help! My boss needs this by the end of the week and I have been working on it all day. I have worked with Excel for two years but it has been pretty basic stuff. This is the first time I've run into a problem that forums and google couldn't help me with.
    Attached Files Attached Files
    Last edited by sesomshom; 09-06-2016 at 07:06 PM.

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Lookup & skipping blank rows

    The following formula is the basis for getting the values from 'Items' without rows of empty cells between those with non-empty cells:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let me know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    09-05-2016
    Location
    Savannah, Georgia
    MS-Off Ver
    2016
    Posts
    3

    Re: Lookup & skipping blank rows

    Thank you so much for the reply! This will be helpful on so many workbook, you have no idea!!!

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Lookup & skipping blank rows

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread 'Solved' using the thread tools link above your first post. I hope that you have a blessed day.

  5. #5
    Registered User
    Join Date
    09-05-2016
    Location
    Savannah, Georgia
    MS-Off Ver
    2016
    Posts
    3

    Re: Lookup & skipping blank rows

    Excel is having a hard time trying to figure out what I'm doing. I enter the formula exactly (changing the sheets and cell numbers to what I need) and afterwards prompted with the error message, informing me the formula is wrong.

    Would someone mind breaking down this formula for me?

    EDIT: Damn commas and parenthesis...
    Last edited by sesomshom; 09-06-2016 at 07:07 PM. Reason: I dun goof'd

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Lookup & skipping blank rows

    =IFERROR(INDEX(Items!B$3:B$10,AGGREGATE(15,6,(ROW(C$1:C$7))/(Items!$D$3:$D$10=$A$1),ROW(A1))),"") My best guess without seeing a file is that you changed the Arguments inside the first ROW function to match your rows. Those arguments report the number of rows to be indexed. If say you have 500 vendors the argument could be ROW(A$1:A$500)
    To break down the formula from the inside out:
    Have already talked about the first ROW function.
    The denominator looks to see if the vendor in column D of the item sheet matches the name in cell A1, this produces a true/false array.
    When the row numbers in the numerator are divided by the true/false array an array of numbers (rows) and #DIV0 errors is created. You can see this by running Evaluate Formula from the Formula tab.
    AGGREGATE's second argument, 6, will ignore the #DIV errors and the first argument, 15, will look for the small(est) number (row) based on the ROW function at the end of the formula, so that when you look at the formula in say Vendor1!B5 you see that the last ROW function has the argument A3, meaning it will find the third smallest (row) number.
    The INDEX function then looks at the value passed to it by AGGREGATE to find the item, unit or price that is the the nth row. So when aggregate passes a 1 it looks to the first row of the B3:B10 which is B3.
    In the event that there isn't one, say when Vendor1!B6 looks for the 4th smallest number, IFERROR returns a blank instead of an error.
    I would suggest that you may want to upload another file that is as close as possible in layout to your actual spreadsheet, including sheet names, while still protecting private/proprietary information.
    You are using version 2013, correct?
    Let me know if you have any questions.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup & skipping blank rows

    =IFERROR(INDEX(Items!B$3:B$10,AGGREGATE(15,6,(ROW(C$1:C$7))/(Items!$D$3:$D$10=$A$1),ROW(A1))),"")
    Try this array formula**:

    =IFERROR(INDEX(Items!B:B,SMALL(IF(Items!$D$3:$D$10=$A$1,ROW(Items!D$3:D$10)),ROWS(A$1:A1))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. "Lookup" data while skipping blank cells
    By jrbrooks34 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-27-2016, 11:38 AM
  2. Replies: 4
    Last Post: 05-16-2014, 04:52 PM
  3. Replies: 14
    Last Post: 01-19-2014, 05:42 AM
  4. [SOLVED] Lookup (with blank rows)
    By namluke in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-30-2013, 02:41 PM
  5. [SOLVED] numbering rows but skipping blank rows
    By cprpacific in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-21-2013, 03:10 PM
  6. Replies: 0
    Last Post: 03-05-2013, 09:22 AM
  7. create a dynamic array skipping #N/A and blank rows?
    By William DeLeo in forum Excel General
    Replies: 5
    Last Post: 11-10-2010, 02:55 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