Forum

Notifications
Clear all

Create List Removing Cells with No Data

4 Posts
4 Users
0 Reactions
107 Views
(@cbfawcet)
Posts: 1
New Member
Topic starter
 

Hi, 

I am looking to generate a list on a new worksheet that pulls data from Column A if Column B has data input. If there is no data in Column B I want the formula to skip all those rows and inly output the value in Column A if there is data in Column B. 

I do not want to use Pivot Table for this for a variety of reasons. My knowledge has me looking at Index/Match or Vlookup formulas. Thanks in advance for your help. 

 
Posted : 21/01/2020 11:04 am
(@gue19)
Posts: 8
Active Member
 

it is a ARRAY formula (STRG + SHIFT + ENTER). copy it and drag it down

=IFERROR(INDIRECT("A"&SMALL(IF(B:B="";"";ROW(A:A));ROW(A2)));"")

 
Posted : 21/01/2020 3:30 pm
(@purfleet)
Posts: 412
Reputable Member
 

Assuming i have set up the data okay (its always better to attach example data so we can see what we are looking at) you have a couple of options here but, in my opinion, the formula is fairly complex.It also depends what version of Excel you are running

In the future you will be able to use the filter function, but this is currently only on Office365 insider. However it is by far the best way

=FILTER(A2:A9,B2:B9="x")

Personally i think advanced filter is the simplest for Excel 2016 and older - you need to select the data table, the criteria (in the same format) and the output location.

https://www.myonlinetraininghub.com/excel-advanced-filter-unique-records

The formula is an array formula so needs ctrl-shift-enter

=IFERROR(INDEX($A$2:$A$9,SMALL(IF("x"=$B$2:$B$9,ROW($A$2:$A$9)-1),ROWS($E$1:E1))),"")

You could also create a quick macro if you are doing it regularly or on lots of work sheets.

Purfleet

 
Posted : 21/01/2020 4:16 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Just some minor suggestion to Purfleet's answers. We don't know what is in column B (may not be an x).

Better to check for non-blank instead of x.

=IFERROR(INDEX($A$2:$A$9,SMALL(IF($B$2:$B$9<>"",ROW($A$2:$A$9)-1),ROWS($E$1:E1))),"")

As for the advanced filter, the criteria can be changed from x to <>

Again to check for non-blank.

This also applies for the FILTER function.

Hope this helps.

Sunny

 
Posted : 22/01/2020 3:31 am
Share: