Display 2 columns of data based on drop down selection

RJB78

Board Regular
Joined
Aug 8, 2016
Messages
73
Office Version
  1. 365
Hello - Looking to display 2 columns of data from a source table based on a selection from a drop down in a separate tab. I have the drop down/data validation already (B1:D1) but need assistance in having the list(s) populate. For the data I'd like to show up, one column is static in terms of value/text (A), the second column displayed (B:D) will change based on the drop down selection. For example, if in the drop down I select 'best', Id like a Rating, price, margin in one column and 3, 3, 3 in the second column.

Maybe there is a better way to do this...

Source table
GoodBetterBest
Rating123
Price123
Margin123
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I wasn't sure if you are looking for a formula to return the desired values or, say, some vba to physically hide the unwanted columns.
Here is a possible formula approach. Is that what you are after?

RJB78.xlsm
ABCD
1MetricGoodBetterBest
2Rating123
3Price123
4Margin123
Sheet1


RJB78.xlsm
ABC
1BestMetricBest
2Rating3
3Price3
4Margin3
Sheet2
Cell Formulas
RangeFormula
B1:C4B1=CHOOSECOLS(Sheet1!A1:D4,1,MATCH(A1,Sheet1!A1:D1,0))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
A1List=Sheet1!$B$1:$D$1
 
Upvote 0
Solution
I wasn't sure if you are looking for a formula to return the desired values or, say, some vba to physically hide the unwanted columns.
Here is a possible formula approach. Is that what you are after?

RJB78.xlsm
ABCD
1MetricGoodBetterBest
2Rating123
3Price123
4Margin123
Sheet1


RJB78.xlsm
ABC
1BestMetricBest
2Rating3
3Price3
4Margin3
Sheet2
Cell Formulas
RangeFormula
B1:C4B1=CHOOSECOLS(Sheet1!A1:D4,1,MATCH(A1,Sheet1!A1:D1,0))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
A1List=Sheet1!$B$1:$D$1

Thank you Peter. Formula is preferred. Using what you provided is very close the solution I'm looking for. I'm running into a small error where the values that are being returned are one column to the left of what I am looking for. Example- if I pick 'Better' it is returning 'Good' data. 'Best' gives me 'Better' Values
 
Upvote 0
Sounds like your data in the first sheet are not in the same columns as mine. You can clearly see that mine occupies columns A, B, C and D in Sheet1. What columns is it for you?

For the future, I suggest that you investigate XL2BB for providing sample data & expected results to make it easier for helpers to understand just what you have & where it is and also what you want & where it is to be.
(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)
 
Upvote 0
Thank you Peter. I found in error in my version of the formula, adjusted for my data. I will look into the XL2BB
 
Upvote 0

Forum statistics

Threads
1,226,466
Messages
6,191,196
Members
453,646
Latest member
SteenP

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