INDEX MATCH + LEFT Function

gcefaloni

Board Regular
Joined
Mar 15, 2016
Messages
87
Hi,

I'm trying to go from the top formula to the bottom one. I have to match H9 (which is a string of 8 characters) to column A which has the same set of information as in column H but with an added number at the end. So I need to be able to match H9 to the leftmost 8 characters in column A. I tried to use an array formula as shown in the example below but it doesn't seem to work. What can I adjust in order for this to work out?

=INDEX($A$9:$B$1000,MATCH(H9,$A$9:$A$1000,0),MATCH(I$8,$A$8:$B$8,0))

={INDEX($A$9:$B$1000,MATCH(H9,LEFT($A$9:$A$1000,8),0),MATCH(I$8,$A$8:$B$8,0))}

Thank you!
 

Some videos you may like

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

mrshl9898

Well-known Member
Joined
Feb 6, 2012
Messages
1,113
Try adding a wildcard to the search *

You can't LEFT a range.

=INDEX($A$9:$B$1000,MATCH(H9&"*",$A$9:$A$1000,0),MATCH(I$8,$A$8:$B$8,0))
 

gcefaloni

Board Regular
Joined
Mar 15, 2016
Messages
87
Try adding a wildcard to the search *

You can't LEFT a range.

=INDEX($A$9:$B$1000,MATCH(H9&"*",$A$9:$A$1000,0),MATCH(I$8,$A$8:$B$8,0))
That works great. Thank you. I didn't think of reversing the problem.
 

AhoyNC

Well-known Member
Joined
Oct 10, 2011
Messages
4,405
Office Version
365
Platform
Windows
Even though I would go with the formula from mrsh9898, you can use LEFT on a range. As long as you entered your formula as an array with CTRL-SHIFT-ENTER it should have worked (see below cell I9). You could have also used the AGGREGATE function with LEFT as in cell I10 (you would enter this the standard way with just ENTER).
Excel Workbook
ABCGHI
8Item1Item2Item2
9wertyuio1qhhhytrewd
10rtyuiopl2sd
11hhhytrew5d
12qwertyui6g
Sheet
 

Forum statistics

Threads
1,089,438
Messages
5,408,221
Members
403,191
Latest member
fmstation

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top