Combining INDEX/MATCH with LEFT

tradeaccepted

New Member
Joined
Jun 11, 2013
Messages
33
Hello,

I am trying to use INDEX/MATCH with LEFT, to change the returned value.

Example:

Data1Data2
5Apples {are great}<are good=""></are>
10Oranges {are also great}<are also="" good=""></are>

<tbody>
</tbody>


=INDEX(B:B,MATCH(5,A:A,0))

This Formula returns the value of Apples {are great}.
Lets say the INDEX/MATCH formula above is in cell C2. I can run the following formula on cell C2 to return only Apples. =LEFT(H2,FIND("{",C2)-1).


How can I combine these two formulas, so that I have only one formula that returns the value of only "Apples"?
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I looked at your previous post. From context I deduced that you must have used < and > to delineate the substrings. As you found, the forum software here interprets those as HTML tags, and tends to mess things up. You can put a space before and after them if you really need to use them. But using {} works too.

ABCDEFG
1Data1Data2
25Apples {are great}Apples {are great}Apples Apples Apples
310Oranges {are also great}Oranges {are also great}Oranges Oranges Oranges
415GrapesGrapes#VALUE!#VALUE!Grapes

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet13

Worksheet Formulas
CellFormula
E2=LEFT(C2,FIND("{",C2)-1)
F2=LEFT(INDEX(B:B,MATCH(A2,A:A,0)),FIND("{",INDEX(B:B,MATCH(A2,A:A,0)))-1)
G2=TRIM(LEFT(SUBSTITUTE(INDEX(B:B,MATCH(A2,A:A,0)),"{",REPT(" ",99)),99))
C2=INDEX(B:B,MATCH(A2,A:A,0))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



In this example, column C and E are your two formulas. Column F is how to combine them directly. But since that version can cause errors (row 4) if the symbol isn't found, you might want to try the formula in G.

Hope this helps.
 
Upvote 0
Eric,

Thank you very much for taking the time to do this. This is a great example, and thanks again for taking the time to point out the potential errors. You are a champion.
 
Upvote 0

Forum statistics

Threads
1,215,268
Messages
6,123,975
Members
449,137
Latest member
yeti1016

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