Home

How to: Search a text value in a column then return the corresponding row text value

%3CLINGO-SUB%20id%3D%22lingo-sub-447847%22%20slang%3D%22en-US%22%3EHow%20to%3A%20Search%20a%20text%20value%20in%20a%20column%20then%20return%20the%20corresponding%20row%20text%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-447847%22%20slang%3D%22en-US%22%3EHi%2C%20I'm%20wondering%20if%20someone%20can%20help%20me%20figure%20out%20the%20correct%20excel%20formula.%20Essentially%20I%20have%20two%20columns%2C%20one%20with%20text%20names%20and%20the%20other%20with%20text%20locations.%20I%20need%20a%20formula%20that%20will%20search%20the%20entire%20column%20for%20a%20specific%20location%20and%20then%20return%20the%20corresponding%20name%20that%20is%20associated%20with%20that%20column's%20cell.%20For%20example%2C%20if%20there%20are%2030%20names%20in%20column%201%20and%2030%20different%20locations%20in%20column%202.%20If%20I%20search%20for%20England%2C%20I%20want%20the%20formula%20to%20return%20for%20me%20the%20corresponding%20name%20in%20column%201%20that%20is%20attached%20to%20England%20in%20column%202.%20Any%20advice%20would%20be%20greatly%20appreciated!%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-447847%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-447974%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%3A%20Search%20a%20text%20value%20in%20a%20column%20then%20return%20the%20corresponding%20row%20text%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-447974%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F320316%22%20target%3D%22_blank%22%3E%40Thetest123%3C%2FA%3E%20%2C%20perhaps%20like%3C%2FP%3E%0A%3CPRE%3E%3DIFNA(INDEX(%26lt%3Bcolumn2%26gt%3B%2CMATCH(%26lt%3Blocation%20name%26gt%3B%2C%26lt%3Bcolumn1%26gt%3B%2C0))%2C%22no%20such%22)%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-448713%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%3A%20Search%20a%20text%20value%20in%20a%20column%20then%20return%20the%20corresponding%20row%20text%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-448713%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi!%20Thank%20you%20so%20much%20for%20your%20response!%20I've%20attached%20a%20sample%20of%20what%20I%20was%20describing%20in%20the%20previous%20post.%20Can%20you%20please%20show%20me%20what%20the%20formula%20would%20be%20for%20if%20I%20want%20it%20to%20return%20the%20name%20associated%20with%20location%20England%20after%20searching%20column%202%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-451049%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%3A%20Search%20a%20text%20value%20in%20a%20column%20then%20return%20the%20corresponding%20row%20text%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-451049%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F320316%22%20target%3D%22_blank%22%3E%40Thetest123%3C%2FA%3E%20%2C%3C%2FP%3E%0A%3CP%3EThat%20is%20like%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20600px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108680i1E060254D4D99900%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Thetest123
New Contributor
Hi, I'm wondering if someone can help me figure out the correct excel formula. Essentially I have two columns, one with text names and the other with text locations. I need a formula that will search the entire column for a specific location and then return the corresponding name that is associated with that column's cell. For example, if there are 30 names in column 1 and 30 different locations in column 2. If I search for England, I want the formula to return for me the corresponding name in column 1 that is attached to England in column 2. Any advice would be greatly appreciated!
3 Replies

@Thetest123 , perhaps like

=IFNA(INDEX(<column2>,MATCH(<location name>,<column1>,0)),"no such")

 

@Sergei Baklan 

Hi! Thank you so much for your response! I've attached a sample of what I was describing in the previous post. Can you please show me what the formula would be for if I want it to return the name associated with location England after searching column 2?