Lookup/index match?

BradleyN1

New Member
Joined
May 5, 2017
Messages
25
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a worksheet which I want to display the comments only from a questionnaire but based on whatever is selected from a list on data validation.

How would I achieve this? Vlookup obviously just picks out the first but I need something so the formula makes it drop a row each time to populate the rest for the unique comments.

My spreadsheet isn't exactly as depicted below but this is the best way I can explain it :)

Comments sheet
A1 Drop down list of names
B1 to B(dependent on number of comments) displays lists of comments based on selection

Another sheet (all the data)
A1 list of names
B1 comments

Thank you!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi Bradley,

You can drag this down to as many comments you think you will return and extend the ranges as needed for your data;


Book1
AB
1NameComments
2AmberIts too hot
3JasonIts too cold
4DavidI like it
5AmberI hate it
6Jasonthats awesome
7DavidIts too hot
8AmberIts too cold
9JasonI like it
10DavidI hate it
11Amberthats awesome
12JasonIts too hot
13DavidIts too cold
14AmberI like it
15JasonI hate it
16Davidthats awesome
Data



Book1
AB
1NameComments
2AmberIts too hot
3I hate it
4Its too cold
5thats awesome
6I like it
Comments
Cell Formulas
RangeFormula
B2{=IF(ROWS(Comments!$B$2:B2)>COUNTIF(Data!$A$2:$A$16,Comments!$A$2),"",INDEX(Data!$B$2:$B$16,SMALL(IF(Data!$A$2:$A$16=Comments!$A$2,ROW(Data!$A$2:$A$16)-ROW(Data!$A$2)+1),ROWS(Comments!$B$2:B2))))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi Bradley,

You can drag this down to as many comments you think you will return and extend the ranges as needed for your data;


Book1
AB
1NameComments
2AmberIts too hot
3JasonIts too cold
4DavidI like it
5AmberI hate it
6Jasonthats awesome
7DavidIts too hot
8AmberIts too cold
9JasonI like it
10DavidI hate it
11Amberthats awesome
12JasonIts too hot
13DavidIts too cold
14AmberI like it
15JasonI hate it
16Davidthats awesome
Data



Book1
AB
1NameComments
2AmberIts too hot
3I hate it
4Its too cold
5thats awesome
6I like it
Comments
Cell Formulas
RangeFormula
B2{=IF(ROWS(Comments!$B$2:B2)>COUNTIF(Data!$A$2:$A$16,Comments!$A$2),"",INDEX(Data!$B$2:$B$16,SMALL(IF(Data!$A$2:$A$16=Comments!$A$2,ROW(Data!$A$2:$A$16)-ROW(Data!$A$2)+1),ROWS(Comments!$B$2:B2))))}
Press CTRL+SHIFT+ENTER to enter array formulas.

You my friend, are amazing!
Thank you :)
 
Upvote 0
You're welcome, thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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