Filtering a Range for Data Validation without Advanced Filter or Code?

idlewild

New Member
Joined
May 15, 2011
Messages
2
Hi All-

I'm a relative n00b so please go easy.

ISSUE SUMMARY:
In Excel 2010, I have a spreadsheet with two tabs: the first tab contains two columns: A which lists the names of individuals and B which lists whether or not they are available (a simple "Yes" or "No" data validated list). So something basic like:

A B
Bob Yes
Pete No
Jane No
Sue Yes

The second tab has a single column, C, against which I want to apply data validation to but only show those people that are available. In other words, I want to filter out those from the first tab's column A whose associated column B is "No." So, C's dropdown options using the sample set about would be "Bob" and "Sue" only.

QUESTION:
Is there a simple, eloquent, way to do this WITHOUT using VBA, advanced filtering, etc. even if I have to create a working data set elsewhere? It seems like I should be able to use a named range and filter it somehow in a formula applied to the data validated list, but I can't figure it out nor find any similar solution online.

Thank you in advance!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Idlewild,

Try this for 2 worksheets Sheet1 (columns A-Name and B-Avaliable - range A1:B21) and Sheet2 (column C):

1) In Sheet1, activate an AutoFilter in A1:B21 (select cell A1/active tab Data/click Filter in the group Sort and Filter).

2) Filter the data in column B (Click the Arow in the cell B1/leave active only Yes and click OK).

3) Select with your mouse the filtered data (only the filtered data of the column A) and copy to the cell C1 (Sheet2).

Markmzz
 
Upvote 0
Idlewild,

Or Try this for 2 worksheets Sheet1 (columns A and B - range A1:B21) and Sheet2 (column C):

1) In the cell D1 of the Sheet1, type this formula (count the number of Yes):

=COUNTIF($B$2:$B$21,"Yes")

2) In the cell C1 of the Sheet2, type Avaliable.

3) In the cell C2 of the Sheet2, type this formula (array formula - so use Ctrl+Shift+Enter and not only Enter):

=IF(ROWS(C$2:C2)<=Sheet1!$D$1,INDEX(Sheet1!$A$2:$A$21,SMALL(IF(Sheet1!$B$2:$B$21="Yes",ROW(Sheet1!$B$2:$B$21)-ROW(Sheet1!$B$2)+1),ROWS(C$2:C2))),"")

4) Now, copy the formula of the cell C2 of the Sheet2, down C3:C? until Excel show a blank cell.

Markmzz
 
Last edited:
Upvote 0
Hi All-

I'm a relative n00b so please go easy.

ISSUE SUMMARY:
In Excel 2010, I have a spreadsheet with two tabs: the first tab contains two columns: A which lists the names of individuals and B which lists whether or not they are available (a simple "Yes" or "No" data validated list). So something basic like:

A B
Bob Yes
Pete No
Jane No
Sue Yes

The second tab has a single column, C, against which I want to apply data validation to but only show those people that are available. In other words, I want to filter out those from the first tab's column A whose associated column B is "No." So, C's dropdown options using the sample set about would be "Bob" and "Sue" only.

QUESTION:
Is there a simple, eloquent, way to do this WITHOUT using VBA, advanced filtering, etc. even if I have to create a working data set elsewhere? It seems like I should be able to use a named range and filter it somehow in a formula applied to the data validated list, but I can't figure it out nor find any similar solution online.

Thank you in advance!
You can create a "filtered" list to another location using formulas and then use this list as the source for your drop down.

Let's assume this is your data:

Book1
AB
1NameStatus
2Name1No
3Name2Yes
4Name3No
5Name4Yes
6Name5No
7Name6Yes
8Name7Yes
9Name8No
10Name9Yes
11Name10Yes
12Name11Yes
13Name12No
14Name13No
15Name14Yes
Sheet1

In the formulas I use the following named ranges:
  • Names
  • Refers to: =Sheet1!$A:$A
  • Status
  • Refers to: =Sheet1!$B$2:$B$15
In the summary area:

Book1
DE
1CountName
28Name2
3_Name4
4_Name6
5_Name7
6_Name9
7_Name10
8_Name11
9_Name14
10__
11__
12__
13__
14__
15__
Sheet1

Enter this formula in D2. This will return the count of records that meet the criteria.

=COUNTIF(Status,"yes")

Enter this array formula** in E2. This will extract the names that meet the criteria.

=IF(ROWS(E$2:E2)>D$2,"",INDEX(Names,SMALL(IF(Status="yes",ROW(Status)),ROWS(E$2:E2))))

** 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.

Copy down until you get blanks.

Now, as the source for your drop down list use this formula:

=E2:INDEX(E2:E15,COUNTIF(E2:E15,"?*"))
 
Upvote 0
Excellent.

Thanks, Markmzz and Biff! I have it working now (with a couple different options)!

Cheers.
Idlewild,

Thanks for the feedback. And consider using the Advanced Filter and Filter (powerful resources of Excel) in the future.

Markmzz
 
Upvote 0
Idlewild,

Or Try this for 2 worksheets Sheet1 (columns A and B - range A1:B21) and Sheet2 (column C):

1) In the cell D1 of the Sheet1, type this formula (count the number of Yes):

=COUNTIF($B$2:$B$21,"Yes")

2) In the cell C1 of the Sheet2, type Avaliable.

3) In the cell C2 of the Sheet2, type this formula (array formula - so use Ctrl+Shift+Enter and not only Enter):

=IF(ROWS(C$2:C2)<=Sheet1!$D$1,INDEX(Sheet1!$A$2:$A$21,SMALL(IF(Sheet1!$B$2:$B$21="Yes",ROW(Sheet1!$B$2:$B$21)-ROW(Sheet1!$B$2)+1),ROWS(C$2:C2))),"")

4) Now, copy the formula of the cell C2 of the Sheet2, down C3:C? until Excel show a blank cell.

Markmzz

Ok Markmzz, This works great for me as well, but I have 2 critera that I need to filter on. for example my list of names may include hundreds of names, a Yes/no column, and a "Certified" column. So I would need to list only those names that were available ("Yes") and certified ("Yes").

I tried to use the AND function within the IF statement, but that didnt work. what would you suggest to only list the the names meeting both requirements?

Thanks,
 
Upvote 0
Ok Markmzz, This works great for me as well, but I have 2 critera that I need to filter on. for example my list of names may include hundreds of names, a Yes/no column, and a "Certified" column. So I would need to list only those names that were available ("Yes") and certified ("Yes").

I tried to use the AND function within the IF statement, but that didnt work. what would you suggest to only list the the names meeting both requirements?

Thanks,
What version of Excel are you using?
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,777
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top