Return corresponding values based off of Data Validation List

imheadsup

New Member
Joined
May 23, 2018
Messages
13
Hello. I want to have a drop-down list with selections and based off of the selection in that list, other cells will populate the corresponding row values associated with that selection. For example, if I select Virginia, the table will return all data for that selection.

Raw data:
StateUniversitiesTuitionCityStudent Population
VirginiaVirginia Tech$60,000 Blacksburg1000
VirginiaUniversity of VA$80,000 Charlottesville2000
VirginiaJames Madison University$40,000 Harrisonburg3000
MarylandUniversity of MD$70,000 College Park4000
MarylandTowson$35,000 Baltimore5000
North CarolinaUNC$60,000 Chapel Hill6000
North CarolinaDuke$65,000 Durham7000
North CarolinaECU$55,000 Greenville8000

<tbody>
</tbody><colgroup><col><col><col><col><col></colgroup>



Select State:Virginia (Drop down list)
StateUniversitiesTuition CityStudent Population
VirginiaVirginia Tech$60,000 Blacksburg1000
VirginiaUniversity of VA$80,000 Charlottesville2000
VirginiaJames Madison University$40,000 Harrisonburg3000

<tbody>
</tbody><colgroup><col><col><col><col><col></colgroup>
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Welcome to the forum.

This formula will extract all the matching records for all the fields for the Data Validation selection in I2.

Copy I5 across and down. You must copy down a sufficient number of rows to cover the number of matches there might be, a number shown in J2.


Book1
ABCDEFGHIJKLM
1StateUniversitiesTuitionCityStudent Population
2MarylandTowson$35,000Baltimore5000Select State:Virginia3
3VirginiaJames Madison University$40,000Harrisonburg3000
4North CarolinaECU$55,000Greenville8000StateUniversitiesTuitionCityStudent Population
5VirginiaVirginia Tech$60,000Blacksburg1000VirginiaJames Madison University40000Harrisonburg3000
6North CarolinaUNC$60,000Chapel Hill6000VirginiaVirginia Tech60000Blacksburg1000
7North CarolinaDuke$65,000Durham7000VirginiaUniversity of VA80000Charlottesville2000
8MarylandUniversity of MD$70,000College Park4000
9VirginiaUniversity of VA$80,000Charlottesville2000
Sheet73
Cell Formulas
RangeFormula
J2=COUNTIFS($A$2:$A$9,$I$2)
I5=IF($J$2>=ROWS($I$5:I5),INDEX(A$2:A$9,1/AGGREGATE(14,6,1/(($A$2:$A$9=$I$2)*(ROW($A$2:$A$9)-ROW($A$1))),IF($J$2>=ROWS($I$5:I5),ROWS($I$5:I5),""))),"")
 
Upvote 0
This worked perfectly. I just need to do a little manipulation to make it work exactly how I need it to for my table and I'll be set to go. Thank you.
 
Upvote 0
Terrific...I'm glad it helped. You're welcome.
 
Upvote 0
Question for you:

I'm having two problems with this now.

1. I have a counter, just like you said, but after about 30 rows of data, I'm getting a #num ! error. Any ideas why?

2. When I select the first value in my drop down list, all respective rows show up (with the exception of anything past row# 30). If I select any other values from my drop down list, the only the first corresponding row data is displayed.

Is there a way I can attach my file so you can see what's happening?
 
Upvote 0

Forum statistics

Threads
1,215,261
Messages
6,123,945
Members
449,134
Latest member
NickWBA

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