IF / VLOOKUP with partial text matching from a cell

kkrishna

New Member
Joined
Jan 12, 2011
Messages
16
Dear All,
I was look for a formula if a cell text is matching partially then vlookup from another sheet for matching value.

Cell A 10.253.19.7

in Cell B & C, the formula should have if Cell A 10.253.19.* then vlookup the value from sheet2 and display Subnet mask & gateway respectively.

Sheet2 has table as below:

[TABLE="class: outer_border, width: 500, align: left"]
<tbody>[TR]
[TD]Subnet[/TD]
[TD]Subnet Mask[/TD]
[TD]Gateway[/TD]
[TD]VLAN[/TD]
[/TR]
[TR]
[TD]10.15.198.[/TD]
[TD]255.255.254.0[/TD]
[TD]10.15.198.1[/TD]
[TD]201[/TD]
[/TR]
[TR]
[TD]10.253.19.[/TD]
[TD]255.255.255.0[/TD]
[TD]10.253.19.1[/TD]
[TD]301[/TD]
[/TR]
</tbody>[/TABLE]






Your assistance on this regards greatly appreciate.

Thank you in advance.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi Markmzz, how about adding "not found" instead #NA when there is no reference value found?

Ok. Try the formulas below (without space and #NA ):

=IFERROR(INDEX(Sheet2!$A$2:$F$10,
MATCH($B$1&$B$2,INDEX(Sheet2!$B$2:$B$10&Sheet2!$F$2:$F$10,),0),
MATCH(C$3,Sheet2!$A$1:$F$1,0))
,"Not found")

=
IFERROR(INDEX(Sheet2!$A$2:$F$10,
MATCH($B$1&$B$2,INDEX(Sheet2!$B$2:$B$10&Sheet2!$F$2:$F$10,),0),
MATCH(SUBSTITUTE($A5,
":",""),Sheet2!$A$1:$F$1,0)),"Not found")

Markmzz
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
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