Match and select

apgmin

Board Regular
Joined
Mar 1, 2010
Messages
150
Office Version
  1. 2013
Platform
  1. Windows
CENTER CODE.xlsx
ABCDEFGHIJKLMNOP
1STATECODEMAHARASHTRAMADHYA PRADESHKARNATAKAGUJARATSTATESTATE CODEDISTRICTDISTRCIT CODE
2GujaratGJAhmednagar 01Agar-Malwa 01Bagalkot01Ahmedabad01Madhya PradeshMPFormula 1Formula 2
3KarnatakaKAAkola 02Alirajpur 02Ballari02Amreli02KarnatakaKAFormula 1Formula 2
4Madhya PradeshMPAmravati 03Anuppur 03Belagavi03Anand03 Formula 1Formula 2
5MaharashtraMHBeed 04Ashoknagar 04Bengaluru Rural04Aravalli04 Formula 1Formula 2
6Bhandara 05Balaghat 05Bengaluru Urban05Banaskantha05 Formula 1Formula 2
7Buldhana 06Barwani 06Bidar06Bharuch06 Formula 1Formula 2
8Chandrapur 07Betul 07Chamarajanagar07Bhavnagar07 Formula 1Formula 2
9Chhatrapati Sambhajinagar 08Bhind 08Chikballapur08Botad08 Formula 1Formula 2
10Dharashiv 09Bhopal 09Chikkamagaluru09Chhota Udepur09 Formula 1Formula 2
CENTER
Cell Formulas
RangeFormula
N2:N10N2=IF(M2>0,VLOOKUP(M2,$A$1:$B$10,2,FALSE),"")
Cells with Data Validation
CellAllowCriteria
M2:M10List=$A$2:$A$10


In Cells M2:M10, we can select only the state names from the list in A1:A10

Corresponding to the state selected the code from b2 to b10 comes up in N2:N10, So Madhya Pradesh in M2 shows MP in N2 and karnataks in M3 shows KA in N3

I need help in

Formula 1: It should make me select only the list of district based on the state selected earlier. Like say in M2, If I select the state names as Madhya Pradesh then I can select the district names listed only in cells F2 to F10 AND If I select the state names as Maharashtra then I can select the district names listed only in cells D2 to D10

Formula 2 should match the district selected in O2 and give the code for that district,

So Say In M2 for Madhya Pradesh if I select the district Ashok Nagar in O2 it should show 04 and If I select Bhind it should show 08

Similarly In M2 for Maharashtra if I select the district Akola in O2, it should show 02 and If I select Beed it should show 04

 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Can only help with Formula 1. Give your options named ranges Uppercase with 3 letters. MAH (D2:D10), MAD (F2:F10), KAR(H2:H10), GUJ (J2:J10). The select all the cells in column O, cell validation -> List -> Insert the INDRECT() formula below. If you stack your selection ranges into 2 columns then it's easy for formula 2, but the way it is structured now, I don't know how to do it in 2013.
Book2
ABCDEFGHIJKLMNOP
1STATECODEMAHARASHTRAMADHYA PRADESHKARNATAKAGUJARATSTATESTATE CODEDISTRICTDISTRICT CODE
2GujaratGJAhmednagar 1Agar-Malwa 1Bagalkot1Ahmedabad1Madhya PradeshMPBarwani
3KarnatakaKAAkola 2Alirajpur 2Ballari2Amreli2KarnatakaKABengaluru Rural
4Madhya PradeshMPAmravati 3Anuppur 3Belagavi3Anand3 
5MaharashtraMHBeed 4Ashoknagar 4Bengaluru Rural4Aravalli4 
6Bhandara 5Balaghat 5Bengaluru Urban5Banaskantha5 
7Buldhana 6Barwani 6Bidar6Bharuch6 
8Chandrapur 7Betul 7Chamarajanagar7Bhavnagar7 
9Chhatrapati Sambhajinagar 8Bhind 8Chikballapur8Botad8 
10Dharashiv 9Bhopal 9Chikkamagaluru9Chhota Udepur9 
Sheet5
Cell Formulas
RangeFormula
N2:N10N2=IF(M2>0,VLOOKUP(M2,$A$1:$B$10,2,FALSE),"")
Cells with Data Validation
CellAllowCriteria
O2:O10List=INDIRECT(UPPER(LEFT(M2,3)))
 
Upvote 0

Forum statistics

Threads
1,223,157
Messages
6,170,419
Members
452,325
Latest member
BlahQz

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