Worksheet name through lookup

tminhv

New Member
Joined
Jun 29, 2023
Messages
16
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
How can I reference a worksheet name from a cell found from a lookup function?

For example, xlookup searches within worksheet 1, 2, and 3 for value. If value is found in worksheet 3, I want it to return "C", if value is found in worksheet 2, I want it to return "B" and so forth.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
You may need to return sheet name first, in cell, i.e, A1 (or any cell) by input this formula in A1:
Code:
=MID(CELL("filename",A1),SEARCH("]",CELL("filename",A1))+1,255)
Then point to this cell A1 to get the sheetname.
For example, search "Value" in range A1:Z100 for sheet1, sheet2,...
Code:
=IF(COUNTIF(Sheet1!A1:Z100,Value),Sheet1!A1,IF(COUNTIF(Sheet2!A1:Z100,Value),Sheet2!A1,...
 
Upvote 0
You may need to return sheet name first, in cell, i.e, A1 (or any cell) by input this formula in A1:
Code:
=MID(CELL("filename",A1),SEARCH("]",CELL("filename",A1))+1,255)
Then point to this cell A1 to get the sheetname.
For example, search "Value" in range A1:Z100 for sheet1, sheet2,...
Code:
=IF(COUNTIF(Sheet1!A1:Z100,Value),Sheet1!A1,IF(COUNTIF(Sheet2!A1:Z100,Value),Sheet2!A1,...
Unfortunately, cell formula doesn't work on 365.
 
Upvote 0
Is there a way to have it work with the online version? or a workaround?
 
Upvote 0
As you have given virtually no information, maybe
Excel Formula:
=IF(ISNUMBER(XMATCH(A2,Sheet1!A2:A100)),"A",IF(ISNUMBER(XMATCH(A2,Sheet2!A2:A100)),"B","C"))
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,579
Members
452,653
Latest member
craigje92

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