Excel Formula: Find Key with Specific Values

What formula do I need to find the Key in column B that has specific values in column A.

Example:
ColumnA      ColumnB
200.              100
300.              20
400.              30
50.                20
600.              20

Find value in column B that has 600, 50 and 300 in column A. Answer = 20.
ouestqueAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Darrell PorterEnterprise Business Process ArchitectCommented:
I created named ranges for the column values and created array formulas.
Look at the formulas in column F along with the notes in Column G.

{=TEXTJOIN(", ",TRUE,IF(ColumnA=E1,ColumnB,""))}

Open in new window

in E2 causes E2 to return 20 when looking for 600 from ColumnA
or
{=TEXTJOIN(", ",TRUE,IF(ColumnB=F1,ColumnA,""))}

Open in new window

in F2 causes F2 to return the comma-delimited list of values "300, 50, 600" in F2.

As stated in G1 and G2,

You have to enter these formulas then press CTRL-SHIFT-ENTER as these are Array formulas.

Many array formulas need a special syntax when entered in Excel. Instead of entering with the the "Enter" key, they need to be entered with Control + Shift + Enter. A formula entered this way will automatically appear with curly braces on either side in the formula bar — do not enter the braces manually.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Do you always have to find the key for the values 600, 50 and 300? Do all those values have the same key? What if those values have different keys?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.