+ Reply to Thread
Results 1 to 8 of 8

Lookup functions to skip over blanks

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    15

    Lookup functions to skip over blanks

    Hi, this is my first time posting. I apologize if I mess up forum protocols. I think my question is a combination of dashboards and Array Functions.

    I have 4 Columns (A - "Earmark", B - "Category", C - "Sub Category", D - "Cost"). I am trying to pull specific values based on a text value that I'm putting in Column (A). The text I put in Column (A) is essentially my way of earmarking the rows I want to group elseward in the sheet (like a dashboard).

    MY GOALS:
    (1) to create a formula (or formulas) that I can copy down
    (2) IF there is a "C" in Column (A), then pull the value from same row in Column (D). If the value in (D) is blank then pull a blank - not a 0.
    (3) IF there is a "s" in Column (A), then pull the value from same row in Column (C) and also Column (D)
    (4) When the formula is copied down, my dashboard list will skip over any blanks from Column (A) and list the next non-blank row that has a "C" or "s" in Column (A)

    So far my mini-dashboard I'm using 2 formulas in 2 different columns...
    Column #1 "Item": =IF(A3="","",IFERROR(VLOOKUP("C",A3:D3,2,0),IFERROR(VLOOKUP("s",A3:D3,3,0),)))
    Column #2 "Cost": =IF(A3="","",IFERROR(VLOOKUP("C",A3:D3,4,0),IFERROR(VLOOKUP("s",A3:D3,4,0),)))

    MY QUESTION:
    Is there a way to omit the blanks and have the new list build itself omitting blanks?

    Thanks in advance for any ideas or help
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Lookup functions to skip over blanks

    Your original expected answer was incorrect, as there are only two FL marked with an "S". I took a completely different approach.

    In F7, copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and in G7, copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You will see that where the amount is tied (rows 7 and 10) the correct state name is returned. Very often, ties result in the first name being returned every time.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: Lookup functions to skip over blanks

    Welcome to the forum.

    I took a different approach to Glenn, and used this formula in cell E3:

    =IF(OR(A3="C",A3="s"),MAX(E$2:E2)+1,"")

    and then copied this down to beyond the bottom of your data, to allow for more data being added. This formula identifies the records that you want to include, and allocates a unique sequential number to each. I assumed you wanted your output table in columns F and G, so I moved your (manual) table across a few columns so that you could compare results directly, and then I put this formula in cell F7:

    =IF(COUNTIF($E:$E,ROWS($1:1))=0,"",IF(AND(INDEX($A:$A,MATCH(ROWS($1:1),$E:$E,0))="C",COLUMNS($F:F)>1),"",INDEX($B:$D,MATCH(ROWS($1:1),$E:$E,0),COLUMNS($F:F)+IF(INDEX($A:$A,MATCH(ROWS($1:1),$E:$E,0))="C",0,1))))

    The formula can be copied across into G7, and then F7:G7 can be copied down as far as you need it. The attached file shows the result.

    Hope this helps.

    Pete
    Attached Files Attached Files

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Lookup functions to skip over blanks

    Another method for F7 drag down

    =IFERROR(INDEX($B$1:$B$17&$C$1:$C$17,AGGREGATE(15,6,ROW($A$3:$A$17)/($A$3:$A$17<>""),ROWS(F$7:F7))),"")

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Lookup functions to skip over blanks

    Another method for
    F7 drag down

    =IFERROR(INDEX($B$1:$B$17&$C$1:$C$17,AGGREGATE(15,6,ROW($A$3:$A$17)/($A$3:$A$17<>""),ROWS(F$7:F7))),"")

    G7 same as Glenn

    =IFERROR(1/(1/INDEX($D$1:$D$17,AGGREGATE(15,6,ROW($A$3:$A$17)/($A$3:$A$17<>""),ROWS(F$7:F7)))),"")


    or combine
    F7 copy to G7 and drag down

    =IFERROR(INDEX(CHOOSE(COLUMNS($F7:F7),INDEX($B$1:$B$17&$C$1:$C$17,),INDEX(1/(1/$D$1:$D$17),)),AGGREGATE(15,6,ROW($A$3:$A$17)/($A$3:$A$17<>""),ROWS(F$7:F7))),"")
    Last edited by Bo_Ry; 11-18-2018 at 06:13 PM.

  6. #6
    Registered User
    Join Date
    08-07-2012
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    15

    Thumbs up Re: Lookup functions to skip over blanks

    Wow, thank you all so much. This is really helpful!! I really appreciate it.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Lookup functions to skip over blanks

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  8. #8
    Registered User
    Join Date
    08-07-2012
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Lookup functions to skip over blanks

    All set, I did both. Thank you all again. This is a great forum and very professional. I'm glad I joined.

+ 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. Skip Blanks in Paste Functions
    By Reyan123 in forum Excel General
    Replies: 2
    Last Post: 11-03-2006, 03:20 AM
  2. [SOLVED] skip blanks
    By Robin Krupp in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-04-2006, 08:50 AM
  3. Skip blanks
    By Art MacNeil in forum Excel General
    Replies: 6
    Last Post: 01-15-2006, 02:55 PM
  4. Skip Over Blanks
    By Kenny in forum Excel General
    Replies: 0
    Last Post: 08-03-2005, 07:05 PM
  5. [SOLVED] Paste Special Skip Blanks not skipping blanks, but overwriting...
    By gsrosin in forum Excel General
    Replies: 0
    Last Post: 02-22-2005, 12:06 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