Do we have like Formula in excel like like vba statement?

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi, do we have like Formula in excel like the "like" vba statement?:)
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I have data [text] like this in col a

MrExcel Online Store Pedie NZ Dept 2X V2
I use vlookup to get data...but at times the there are more spaces being added or reduced though Pedie NZ part always remains the same...I just don't know what to do...I want the vlookup to match [likely] but accuately only Pedie NZ part...


Thanks again for hepling.
 
Upvote 0
I have data [text] like this in col a

MrExcel Online Store Pedie NZ Dept 2X V2
I use vlookup to get data...but at times the there are more spaces being added or reduced though Pedie NZ part always remains the same...I just don't know what to do...I want the vlookup to match [likely] but accuately only Pedie NZ part...


Thanks again for hepling.
You could try something like...

=VLOOKUP("*"&"Pedie"&"*"&"NZ"&"*",Table,Col,0)
 
Upvote 0
Alladin thanks a lot. But I have a long list of names in this way
This work but would consume lots of time...will there be other way
Like to vlookup(A1,....etc?
 
Upvote 0
Alladin thanks a lot. But I have a long list of names in this way
This work but would consume lots of time...will there be other way
Like to vlookup(A1,....etc?

The suggestion involves manipulating the look up value, not the table.
We can make that a bit easier though...

A1: Pedie NZ

B1:

=VLOOKUP(SUBSTITUTE(A1," ","*"),$E$2:$F$400,2,0)

Note that this would match occurrences in E2:E100 like "Pedie in NZ", "PedieNZ", "Pedie NZ", etc as wel as "Pedie NZ".
 
Upvote 0
Since "like" exists in VBA, why not use it to create your own ?

Function IsLike(CellToMatch, Pattern) As Boolean
IsLike = CellToMatch Like Pattern
End Function

and call it like (no pun intended)

=IsLike(B9,"*XX*A6*")

or similar
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

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