To modify your index match formula with 2 criteria in VBA to include "@" symbol, you can use the following code:
Dim ws As Worksheet
Dim lastRow As Long
Dim nameColumn As Long
Dim dateColumn As Long
Dim nameToFind As String
Dim dateToFind As String
Set ws = ThisWorkbook.Worksheets("Sheet1") 'Modify sheet name as needed
lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row 'Assuming data starts from A1
nameColumn = 1 'Modify column number as needed
dateColumn = 2 'Modify column number as needed
nameToFind = "John@Doe" 'Modify name to find as needed
dateToFind = "1/1/2022" 'Modify date to find as needed
Dim result As Variant
result = Application.Index(ws.Range("C2:C" & lastRow), _
Application.Match(nameToFind & dateToFind, _
ws.Range("A2:A" & lastRow) & "@" & _
Format(ws.Range("B2:B" & lastRow), "ddmmyyyy"), 0))
MsgBox "Result: " & result
'Note: The above code assumes that the result is in column C. Modify it as per your data.
In the above code, the index match formula with 2 criteria is modified to concatenate the "@" symbol with the date column using the "&" operator in the application.match function. This will help to find the exact match with the criteria including the "@" symbol.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-05-11 01:52:01 +0000
Seen: 18 times
Last updated: May 11 '23
How can one generate a list by using a portion of another list?
What is the calculation for the combination index?
What is the way to incorporate BitSet in Go?
What is the process of organizing strings into an index called?
In c#, what is the method to obtain the index of an element in a List<T>?
How can the DataFrame index be expanded or enlarged?
How can we manipulate the range of a string slice in the Golang template?
What is the procedure for removing all vectors within a specific namespace index in Pinecone?