+ Reply to Thread
Results 1 to 7 of 7

"Lookup" data while skipping blank cells

  1. #1
    Registered User
    Join Date
    04-27-2016
    Location
    Springdale, Arkansas
    MS-Off Ver
    2010
    Posts
    2

    "Lookup" data while skipping blank cells

    I am trying use a referenced cell similar to a Vlookup, but the data I'm looking up for said reference cell, I want to only return the non-blank data cells, because my data contains blank cells.

    My sheet is more complicated but, if I could get the example shown below to work I could make it work for my bigger, more complex spreadsheet.

    I search around and was able to find an array formula that is working for me...but only if the data contains values. And my data contains both values/non-values. I have struggled to find a formula that will work in both cases.



    I have attached the example. I have my data in A2:B7. Column A2:A7 are my labels/references, Column B2:B7 are my data inputs (includes the blank) plus values/non-values.
    Cell A12 & A13 has the matching references from A2:A7 I want to lookup. My formula is successful in B12 for referencing cell A12 because the input in B2:B7 is a value. My formula is NOT successful in B13 referencing cell A13 because the input in B2:B7 is a Non-value. I am using the MAX function, which is why Im guessing it doesn't like non-value data.

    My formula is =IF(MAX(IF(($A$2:$A$7=A12)*($B$2:$B$7<>0),$B$2:$B$7))=0,"",MAX(IF(($A$2:$A$7=A12)*($B$2:$B$7<>0),$B$2:$B$7))). Of Course with an Array.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: "Lookup" data while skipping blank cells

    Hi,

    Is it an option to sort the data first. i.e. sort by Reference small to large and Input Z to A which means that the non blank values will always be the first item. Then a straightforward

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 04-27-2016 at 11:00 AM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: "Lookup" data while skipping blank cells

    Try this in B12 and filled down

    =IFERROR(LOOKUP(2,1/(($A$2:$A$7=A12)*($B$2:$B$7<>"")),$B$2:$B$7),"")

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

    Re: "Lookup" data while skipping blank cells

    Try this...

    Data Range
    A
    B
    1
    Reference
    Input
    2
    123
    3
    123
    56789
    4
    123
    5
    345
    6
    345
    10YD
    7
    345
    8
    9
    10
    11
    Lookup
    12
    123
    56789
    13
    345
    10YD


    This formula entered in B12 and copied down:

    =IFERROR(LOOKUP(2,1/((A$2:A$7=A12)*(B$2:B$7<>"")),B$2:B$7),"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    04-27-2016
    Location
    Springdale, Arkansas
    MS-Off Ver
    2010
    Posts
    2

    Re: "Lookup" data while skipping blank cells

    This is working perfectly guys. Very much appreciated help!!!!

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: "Lookup" data while skipping blank cells

    You're welcome.

  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" data while skipping blank cells

    You're welcome. Thanks for the feedback!

+ 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] Copy cells from range "C3" to "F3" with loop and blank field
    By masterm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2015, 01:03 PM
  2. [SOLVED] Keeping particular cell blank if the related cells show "0" or "blank"
    By Anuru in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-24-2014, 05:30 AM
  3. [SOLVED] Replace all BLANK cells in column with header title "Balance" to "0"
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2014, 09:25 AM
  4. [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
  5. [SOLVED] Data validation: allow entry into a cell if other three cells have "X", "Y" and "Z"?
    By RogerRangeRover in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-05-2013, 04:49 AM
  6. dragging "rank order" function down, skipping grouped cells
    By theletterh in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-04-2012, 06:52 PM
  7. Replies: 3
    Last Post: 02-16-2011, 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