Index and Match

Lizzi

Board Regular
Joined
Sep 23, 2011
Messages
160
Office Version
  1. 2016
Platform
  1. Windows
Hi,
Can someone please help me with the index/match formula, i have never used it before and i'm having issues with Vlookup as its only looking at the first value.

my sheet1 has a column (DG in my workbook) with id's in it, another worksheet (2) in the same file has a table A:C containing company names in Col A, id's in Col B and Sales persons name in Col C, i want it to match the site id in Col DG on sheet1 to the sales person in sheet2 but i don't know how to do that. some company names are the same but have different id's but the same person which is why vlookup didn't work for me.

any help greatly appreciated....thanku in advance

Liz
 

Attachments

  • Index_Match example.png
    Index_Match example.png
    19.1 KB · Views: 8

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
try something like this:
(I made up my own numbers)
Book1
ABCDEFG
1
2Comp NameIDSalesLkup RngCol DG IDSales
3Comp A402457Liz953004Ben
4Comp A668448Liz899372Paul
5Comp A848952Liz7857130
6Comp A362857Liz402457Liz
7Comp B449683Harry668448Liz
8Comp C953004Ben848952Liz
9Comp D899372Paul362857Liz
10Comp G785713449683Harry
Sheet2
Cell Formulas
RangeFormula
G3:G10G3=INDEX($C$3:$C$10,MATCH(F3,$B$3:$B$10,0))
 
Upvote 0
Thanku, it mostly worked but i got some #NA lines? even though the id matches and there is a sales person assigned to the id....confused
 
Upvote 0
Or try this:

Book1
ABCDEFG
1
2Comp NameIDSalesCol DG IDSales
3Comp A402457Liz953004Ben
4Comp A668448Liz899372Paul
5Comp A848952Liz7857130
6Comp A362857Liz402457Liz
7Comp B449683Harry668448Liz
8Comp C953004Ben848952Liz
9Comp D899372Paul362857Liz
10Comp G785713449683Harry
Sheet1
Cell Formulas
RangeFormula
G3:G10G3=IFERROR(VLOOKUP(""&F3,$B$3:$C$10,2,0),VLOOKUP(0+F3,$B$3:$C$10,2,0))
 
Upvote 0
Solution
Or try this:

Book1
ABCDEFG
1
2Comp NameIDSalesCol DG IDSales
3Comp A402457Liz953004Ben
4Comp A668448Liz899372Paul
5Comp A848952Liz7857130
6Comp A362857Liz402457Liz
7Comp B449683Harry668448Liz
8Comp C953004Ben848952Liz
9Comp D899372Paul362857Liz
10Comp G785713449683Harry
Sheet1
Cell Formulas
RangeFormula
G3:G10G3=IFERROR(VLOOKUP(""&F3,$B$3:$C$10,2,0),VLOOKUP(0+F3,$B$3:$C$10,2,0))
thank you! the first one worked actually when i realised that i had spaces in the cell, i corrected that and it worked
 
Upvote 0
Or try this:

Book1
ABCDEFG
1
2Comp NameIDSalesCol DG IDSales
3Comp A402457Liz953004Ben
4Comp A668448Liz899372Paul
5Comp A848952Liz7857130
6Comp A362857Liz402457Liz
7Comp B449683Harry668448Liz
8Comp C953004Ben848952Liz
9Comp D899372Paul362857Liz
10Comp G785713449683Harry
Sheet1
Cell Formulas
RangeFormula
G3:G10G3=IFERROR(VLOOKUP(""&F3,$B$3:$C$10,2,0),VLOOKUP(0+F3,$B$3:$C$10,2,0))
it worked after i use the trim formula to clean the cell up as i had trailing spaces......thanku :)
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,120
Members
453,021
Latest member
Justyna P

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