Manoj
Manoj

Reputation: 461

How to Ignore Blanks

Example Pic:

Hi, I got the solution with helper column. Can I get answer without helper column as shown in the picture. Thanks in advance..

Upvotes: 0

Views: 313

Answers (2)

David Leal
David Leal

Reputation: 6769

Try this on cell E2, using LET for easy reading of the expression:

=LET(teams, A2:A5, names, B2:B5, dropDownValue, D2,
  helper, SCAN("", teams, LAMBDA(acc,tt, IF(acc="", tt, IF(tt="", acc, tt)))),
  FILTER(names, helper=dropDownValue)
)

or just using the ranges:

=FILTER(B2:B5,SCAN("",A2:A5,LAMBDA(acc,tt,IF(acc="",tt,IF(tt="",acc,tt))))=D2)

the idea is just to create the helper column on the fly via SCAN function. The rest is just to use FILTER function based on the drop-down value in cell D2. Here is the output:

sample excel file

Note: Based on your sample data, it is assumed the first value of teams column is non-empty and with the color value.

Upvotes: 2

Harun24hr
Harun24hr

Reputation: 37125

Use SCAN() function with FILTER().

=FILTER(D6:D17,SCAN("",C6:C17,LAMBDA(a,b,IF(b="",a&b,b)))=G6)
  • Here SCAN() will generate an array filling empty cells with value of its above cell. Then just filter D column based on that array.

enter image description here

Upvotes: 6

Related Questions