Function to conditionally sort data

stephanie24

New Member
Joined
Apr 26, 2010
Messages
4
I had a question regarding a fix I am in while trying to analyze a data. Here's what I am lookin for.

A B C D
14 6331
14 8164
14 4731
14 6416
14 8106
15 4764
15 6218
15 6256
15 6372
16 6422
16 4829
16 4941
16 4963
17 6212
17 6371
18 6582
18 6642
18 8143
19 6349
19 6611
19 4710
20 4797
20 4815
20 4831
20 6217
14 6227
14 6364
14 6383

If I put in a value,(say 14) in cell C1, I want all the values in column B corresponding to 14,15,and 16 (in column A) in column D. I think it has something to do with index and match with an if function. It would be really helpful if someone can help me with a function which gives me the desired result. Please find the attached spreadsheet for your reference.
Thank you in advance.
<!-- / message --><!-- attachments -->
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Not sure how you want to decipher 14, 15 and 16 out of a single entry of 14, but you can tweak the "key" formula to do what you want in that regard.

Excel Workbook
ABCDE
1CodeValueKeySearchValues
21463311146331
314816428164
414473134731
514641646416
614810658106
715476456227
815621856364
915625656383
101563725
111664225
121648295
131649415
141649635
151762125
161763715
171865825
181866425
191881435
201963495
211966115
221947105
232047975
242048155
252048315
262062175
271462276
281463647
291463838
Sheet3
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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