Search a value in multiple columns and return a value

david427

New Member
Joined
Jun 30, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
Hello,

Im trying to match a value on multiple columns and return an specific value. The problem is, ive already tried all lookup, index and match formulas and no one worked for this.

Example of what im trying to do: i have like 5 columns of massive information incluiding 3 columns of MAILS, i want to lookup in those mails and return a specific ID from the Column A.

1625058820979.png


Thanks in advance for the help
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I'm not sure about a formula but if you are open to using a macro, I may have a solution for you. Would you have more than one lookup email in column F?
 
Upvote 0
Hi Mumps,

No, only 1 email in column F.

Im able to use macros =)
 
Upvote 0
Try:
VBA Code:
Sub ReturnValue()
    Application.ScreenUpdating = False
    Dim LastRow As Long, fnd As Range, email As Range
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    For Each email In Range("F2", Range("F" & Rows.Count).End(xlUp))
        Set fnd = Range("B:D").Find(email.Value, LookIn:=xlValues, lookat:=xlWhole)
        If Not fnd Is Nothing Then
            email.Offset(, 1) = Range("A" & fnd.Row)
        End If
    Next email
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,741
Messages
6,126,594
Members
449,320
Latest member
Antonino90

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