Skip to main content

Vlookup with wildcard

The VLOOKUP function in Excel can be used with wildcard characters to find and retrieve data based on a partial match of a lookup value. The wildcard characters that can be used with VLOOKUP are the "*" (asterisk) and "?" (question mark) characters. The "*" (asterisk) character is used to match any sequence of characters, while the "?" (question mark) character is used to match any single character. To use a wildcard character with VLOOKUP, you need to include the wildcard character in the lookup value within quotation marks. For example, to find the price of a product that starts with the letter "A" and has any number of characters after it, you can use the following formula: =VLOOKUP("A*",A1:C10,3,FALSE) This formula will look for the value "A*" in the first column of the range A1:C10, and if it finds a match, it will return the value in the third column of the same row. Similarly, if you want to find a product that starts with letter "A" and ends with "X" in the first column of the range A1:C10, you can use the following formula =VLOOKUP("A?X",A1:C10,3,FALSE) This formula will look for the value "A?X" in the first column of the range A1:C10 and it will return the value in the third column of the same row if it finds a match. It is important to note that the wildcard characters only work in the lookup value, not in the criteria_range, it will throw an error if you use wildcard characters in the criteria_range.

Comments

Popular posts from this blog

Get multiple lookup values in single cell

Rupees into words

Option Explicit Function RupeesInWords(ByVal MyNumber As Double) As String Dim Rupees As String Dim Paise As String Dim Temp As String Dim DecimalPlace As Integer MyNumber = Round(MyNumber, 2) DecimalPlace = InStr(MyNumber, ".") If DecimalPlace > 0 Then Rupees = Left(MyNumber, DecimalPlace - 1) Paise = Mid(MyNumber, DecimalPlace + 1) Else Rupees = MyNumber Paise = "" End If RupeesInWords = "" If Val(Rupees) > 0 Then RupeesInWords = ConvertToWords(Rupees) & " Rupees" End If If Val(Paise) > 0 Then RupeesInWords = RupeesInWords & " and " & ConvertTwoDigits(Left(Paise & "00", 2)) & " Paise" End If RupeesInWords = Application.WorksheetFunction.Trim(RupeesInWords) & " Only" End Function Private Function ConvertToWords(ByVa...