Partial cell Match

chadlaw32

Board Regular
Joined
Jul 29, 2014
Messages
84
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
I am trying to right a formula that will look up the firs set of values in a cell where there are numbers separated by a dash below is an example of the data. I want to look up the 301 or 024. Any ideas?
[TABLE="width: 91"]
<colgroup><col></colgroup><tbody>[TR]
[TD]301-513410[/TD]
[/TR]
[TR]
[TD]303-545826[/TD]
[/TR]
[TR]
[TD]024-562515[/TD]
[/TR]
[TR]
[TD]303-556837[/TD]
[/TR]
[TR]
[TD]027-499338[/TD]
[/TR]
[TR]
[TD]303-557957[/TD]
[/TR]
[TR]
[TD]313-518514[/TD]
[/TR]
</tbody>[/TABLE]
 
Get rid of column D I want to look up part of column B. 301 an 303 and 024 on your table where i have another table that says 301 is city A and 303 is city b and 024 is city C.

=VLOOKUP(LEFT(B2,FIND("-",B2)-1),Table,2,0)

The first column of Table must be text. If it is a mix of text values and true numbers, we need to tweak this formula.
 
Last edited:
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

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