Index Match with Left function?

g17

New Member
Joined
May 13, 2011
Messages
13
hoping someone might be able to help?

trying to copy a value from one sheet to another with the following criteria:

-if the first 6 numbers of the SKU on Sheet 1 matches the SKU on Sheet 2, copy the Price on Sheet 2 to Sheet 1. I used the following formula but it returns an N/A value.

=INDEX('Sheet 2'!B2:B3, MATCH(LEFT(B2,6),'Sheet 2'!A2:A3,0),1)

HTML:
Sheet 1

SKU                          Price
12345678901                 (Formula goes here)
23456789012         


Sheet 2

SKU                          Price
123456                       $9.98
234567                       $34.98
tnx!
-g
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Does this work for you:
=INDEX(Sheet2!B2:B3, MATCH(LEFT(A2,6)*1,Sheet2!A2:A3,0),1)

It returns $9.98 in my test file.
 
Last edited:
Upvote 0
Welcome to the forums!

The problem with using a string function on numbers to try to compare with other numbers is that a formatting issue arises. You either have to compare a string with a string, or numbers with numbers.

To fix your issue, you can use:
=INDEX('Sheet 2'!B2:B3, MATCH(VALUE(LEFT(B2,6)),'Sheet 2'!A2:A3,0),1)

or

=INDEX('Sheet 2'!B2:B3, MATCH(LEFT(B2,6)*1,'Sheet 2'!A2:A3,0),1)
 
Upvote 0
hoping someone might be able to help?

trying to copy a value from one sheet to another with the following criteria:

-if the first 6 numbers of the SKU on Sheet 1 matches the SKU on Sheet 2, copy the Price on Sheet 2 to Sheet 1. I used the following formula but it returns an N/A value.

=INDEX('Sheet 2'!B2:B3, MATCH(LEFT(B2,6),'Sheet 2'!A2:A3,0),1)

HTML:
Sheet 1
 
SKU                          Price
12345678901                 (Formula goes here)
23456789012         
 
 
Sheet 2
 
SKU                          Price
123456                       $9.98
234567                       $34.98
tnx!
-g
Try it like this...

=INDEX('Sheet 2'!B$2:B$3,MATCH(--LEFT(B2,6),'Sheet 2'!A$2:A$3,0))

Copy down as needed.
 
Upvote 0
1]

C2, Sheet 1

=INDEX('Sheet 2'!$B$2:$B$3, MATCH(LEFT(B2,6)+0,'Sheet 2'!$A$2:$A$3,0))

2]

C2, Sheet 1:

=LOOKUP(9.99999999999999E+307,FIND('Sheet 2'!$A$2:$A$3,LEFT(B2,6)),'Sheet 2'!$B$2:$B$3)
 
Upvote 0
this one works for me:

=INDEX(Sheet2!B2:B3, MATCH(LEFT(A2,6)*1,Sheet2!A2:A3,0),1)

thanks everyone for the super speedy replies! u guys r awesome. =)
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,560
Members
449,089
Latest member
Motoracer88

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