Find the data and get the cell address

mb8marmed

New Member
Joined
Feb 15, 2020
Messages
11
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
  8. 2007
  9. 2003 or older
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I am looking for data in a table if it exists, and I use Ctrl + F to manually find the data within the table. However, I am wondering if there is a way to use the combined Excel functions such as Index, Match, & Address (or any other function). The data to look at is in Sheet 1, and the lookup value is located in Sheet 2. Once the data is found in Sheet 1, the cell reference will be documented in Sheet 2, otherwise it will return to "Not Found". I attached a sample of the work using xl2bb for reference. It would also be great if you could provide me with an Excel function and an alternative VBA code.

Thank you in advance.

Find the Data.xlsx
BCDEF
1Items to Find
2RFI-001RFI-021RFI-031RFI-041RFI-051
3RFI-002RFI-022RFI-032RFI-042RFI-052
4RFI-003RFI-023RFI-033RFI-043RFI-053
5RFI-004RFI-024RFI-034RFI-044RFI-054
6RFI-005RFI-025RFI-035RFI-045RFI-055
7RFI-006RFI-026RFI-036RFI-046RFI-056
8RFI-007RFI-027RFI-037RFI-040RFI-057
9RFI-008RFI-028RFI-038RFI-048RFI-058
10RFI-009RFI-029RFI-039RFI-049RFI-059
11RFI-010RFI-030RFI-040RFI-050RFI-060
12RFI-011RFI-031RFI-041RFI-051RFI-061
13RFI-012RFI-032RFI-042RFI-052RFI-062
14RFI-013RFI-033RFI-043RFI-053RFI-063
15RFI-014RFI-034RFI-044RFI-054RFI-064
16RFI-015RFI-035RFI-045RFI-055RFI-065
17RFI-016RFI-036RFI-046RFI-056RFI-066
18RFI-017RFI-037RFI-047RFI-057RFI-067
19RFI-018RFI-038RFI-048RFI-058RFI-068
20RFI-019RFI-039RFI-049RFI-059RFI-069
21RFI-020RFI-040RFI-050RFI-060RFI-070
Sheet1


Find the Data.xlsx
BCDE
2ItemLookup ValueCell Ref.Sheet Tab
31RFI-0001Not FoundNot Found
42RFI-024C5Sheet 1
53RFI-040D11, E8Sheet 1
64RFI-068F19Sheet 1
75RFI-xxxNot FoundNot Found
Sheet2
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Does this do what you want?

mb8marmed.xlsm
BCD
2ItemLookup ValueCell Ref.
31RFI-0001Not found
42RFI-024C5
53RFI-040E8, D11, C21
64RFI-068F19
75RFI-xxxNot found
Sheet2
Cell Formulas
RangeFormula
D3:D7D3=LET(r,Sheet1!$B$2:$F$21,a,TEXTJOIN(", ",1,IF(r=C3,ADDRESS(ROW(r),COLUMN(r),4),"")),IF(a="","Not found",a))
 
Upvote 0
Solution
Does this do what you want?

mb8marmed.xlsm
BCD
2ItemLookup ValueCell Ref.
31RFI-0001Not found
42RFI-024C5
53RFI-040E8, D11, C21
64RFI-068F19
75RFI-xxxNot found
Sheet2
Cell Formulas
RangeFormula
D3:D7D3=LET(r,Sheet1!$B$2:$F$21,a,TEXTJOIN(", ",1,IF(r=C3,ADDRESS(ROW(r),COLUMN(r),4),"")),IF(a="","Not found",a))

Does this do what you want?

mb8marmed.xlsm
BCD
2ItemLookup ValueCell Ref.
31RFI-0001Not found
42RFI-024C5
53RFI-040E8, D11, C21
64RFI-068F19
75RFI-xxxNot found
Sheet2
Cell Formulas
RangeFormula
D3:D7D3=LET(r,Sheet1!$B$2:$F$21,a,TEXTJOIN(", ",1,IF(r=C3,ADDRESS(ROW(r),COLUMN(r),4),"")),IF(a="","Not found",a))

Oh, that was a very fast answer. I even forgot that I have three instances of RFI-040 (E8, D11, and C21). Do you have an alternative approach for legacy Excel and how to get the sheet tab in case I have more Excel tabs? Thank you so much.
 
Upvote 0
Does this do what you want?

mb8marmed.xlsm
BCD
2ItemLookup ValueCell Ref.
31RFI-0001Not found
42RFI-024C5
53RFI-040E8, D11, C21
64RFI-068F19
75RFI-xxxNot found
Sheet2
Cell Formulas
RangeFormula
D3:D7D3=LET(r,Sheet1!$B$2:$F$21,a,TEXTJOIN(", ",1,IF(r=C3,ADDRESS(ROW(r),COLUMN(r),4),"")),IF(a="","Not found",a))
Oh, that was a very fast answer. I even forgot that I have three instances of RFI-040 (E8, D11, and C21). Do you have an alternative approach for legacy Excel and how to get the sheet tab in case I have more Excel tabs? Thank you so much.

This one is working on my computer, and this is what I need. However, we are using legacy Excel in our office.

Thank you so much.
 
Upvote 0
Getting the sheet name by formula or vba seem a bit funny since you are already telling Excel to look on a particular sheet. However, see if something like this would suit for all versions.

VBA Code:
Function GetAddr(r As Range, s As String) As String
  Dim c As Range
  
  For Each c In r
    If c.Value = s Then GetAddr = GetAddr & ", " & c.Address(0, 0)
  Next c
  If GetAddr = "" Then
    GetAddr = "Not found"
  Else
    GetAddr = Mid(GetAddr, 3)
  End If
End Function
VBA Code:
Function GetSheet(r As Range) As String
  GetSheet = r.Parent.Name
End Function

mb8marmed.xlsm
CEF
2Lookup ValueCell Ref.Sheet Tab
3RFI-0001Not foundNot found
4RFI-024C5Sheet1
5RFI-040E8, D11, C21Sheet1
6RFI-068F19Sheet1
7RFI-xxxNot foundNot found
Sheet2
Cell Formulas
RangeFormula
E3:E7E3=GetAddr(Sheet1!B$2:F$21,C3)
F3:F7F3=IF(E3="Not found",E3,GetSheet(Sheet1!B$2:F$21))
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,635
Members
452,661
Latest member
Nonhle

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