I can reference a sheet name from another sheet
='Sheet1'!A1
How can I do thus with formula (not VBA or Python, sadly) to find out the name of the sheet dynamically (ie without knowing the name sheet)? Just to be clear I'm after the sheet names/ tab names at the bottom of the window, not the worksheet name
I've got number of spread sheets with a number of sheets (all named differently) and I was looking for a formula that will work with all. One size fits all , if you will.
Try this:
In the Name Manager create a Name using this formula:
=REPLACE(GET.WORKBOOK(1),1,FIND("]",GET.WORKBOOK(1)),"")
Then in your worksheet, use INDEX function to retrieve sheet names like this:
=INDEX(SheetList,1)
To List all sheets then select the target range and enter SheetList as array formula using Ctrl+Shift+Enter.
{=SheetList}
Related
I have an Excel workbook that contains a number of individual worksheets. The cells on one of the sheets are linked to individual cells on other worksheet in the same workbook. I'm using a direct cell reference that essentially says that whatever value is entered into a particular cell on one sheet also populates cells on the other sheet. I used the (=) function with the cell reference to accomplish this.
The issue I'm running into is that, even when the primary cell is left blank, the cells that populate from that primary cell will display 0, rather than a text that I want to be display like: "No data here" .
I want the subordinate cells to display "No data here" if the primary cell they're linked to are blank.
Is there a way of doing this?
Use the ! operator to reference cells on other worksheets.
So you can construct the formula like this:
=IF(Sheet1!A1="","Source cell is blank",Sheet1!A1)
Obviously, replace "Sheet1" with the name of your source data sheet.
I am trying to list all sheets in an Excel workbook with a method that works for macro-free workbooks such as .xlsx files.
I am aware of the following options although both require the workbook to be saved in a file format that allows macros:
Method 1: Excel 4 Function
See this answer I posted.
Method 2: VBA
See this answer posted by another user.
Is there any option to list all sheets? If not is there any formula that names any sheet beyond the sheet containing the formula?
If you have the flexibility, you can use the formula from #urdearboy in e.g. A1 on each sheet, then use a 3D reference to collect them together e.g. =TEXTJOIN(CHAR(10), FALSE,'FirstSheet:LastSheet'!A1) and then extract from the string.
It's a big kludge but it does work. (But at the moment I'm happy with all the sheets listed in 1 cell; A1 contains sheetname + description)
Caveat - FirstSheet & LastSheet must obviously span the range of sheets to be listed, and if they get moved around, the 3D reference may be inappropriate or break
This is a great question in the context of building macro-free workbooks.
To make an contents list of sheetnames, the formula from #urdearboy can be pasted in cell A1 of each sheet being indexed:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
If cell A1 of each of these sheets is made a named range, using foo_1, foo_2, foo_3 etc as the names, the index is simply =foo_1 in the first cell of the contents range, or better =indirect("foo_", 1), with 1 replaced by a cell reference to a number sequence.
The content list stays up-to-date, even if the sheet names are changed.
Hi I hope someone can help.
I have a workbook column A is populated with titles leaving column B for data.
There is only these 2 columns in use.
I have the same titles in column A replicated on a series of sheets with column B filled out with client data.
On my first sheet (no data in column B) I'm attempting to use a single drop-down populated with the names given to the sheets on my workbook.
When a sheet name is selected from the drop-down This is to fill in the data from the corresponding sheet.
It's worth noting that all the titles are in the same cells on each sheet.
I can amalgamate all the client data onto one sheet if it's required for a solution but require one set of the data from a single drop-down on a separate sheet
I thought I might manage this with with some kind of range Vlookup linked to a separate sheet with the individual sheet names but i can't get my head round it.
Any help greatly appreciated.
Generally I use formulas in excel so if it's possible with VLookup or similar that's great if not then please drop some code for VBA.
From your description, Sheet11 is a customer data sheet and looks like this ...
The sheet that is looking up customer data looks like this ...
Cell D2 contains the drop down list to choose which customer data sheet to look at, in this case Sheet11.
Cell B2 contains the following formula, filled down...
=IF(ISERROR(VLOOKUP(A2,INDIRECT("'"&$D$2&"'!"&"A:B"),2,FALSE)),"",VLOOKUP(A2,INDIRECT("'"&$D$2&"'!"&"A:B"),2,FALSE))
It constructs a string representing the customer data to look in, and uses the INDIRECT function to convert that string into a valid reference. It uses VLookup to find the data of interest. If VLookup returns an error, a null string is returned, otherwise the customer data is returned.
Note: When constructing the string, the sheet name is enclosed in single quotes, in the event there is a space in the sheet name.
I'd like to know if it is possible to link two sheets so that if I add a row in one sheet it autmatically gets added to the second sheet.
Thanks.
Not exactly -- I'm pretty sure you can't link an entire sheet. But you could use formulas with cell references, e.g. =Sheet2!B2 refers to cell B2 from Sheet2.
You could also try the vlookup() formula function. If you have a table defined somewhere in the workbook, you can use this function to return the value from one column of the table based on the supplied value from another column in the table.
You can "Group" sheets together by holding down CTRL and selecting the tabs of the sheets to be grouped. Adding and deleting rows and columns would result in the same treatment over all the selected sheets. But this is temporary and is lost as soon as another sheet is selected or the file is closed.
For a longer term entanglement, you would need VBA code.
I have 30 sheets in one workbook. In Sheet1, how can I use a formula to return sheet names of the other 29 sheets within the same workbook? My preference is not to use udf or vba.
This is the formula I am using to return the name of the active worksheet:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,25)
I modified the formula to this:
=MID(CELL("filename",'Sheet 1'!A1),FIND("]",CELL("filename",'Sheet 1'!A1))+1,25)
but when I use this formula, I get a message box titled "Update Values: Sheet 1" - essentially prompting me to select the workbook. Once I select the workbook, I am prompted to select the sheet. Once I do that, the formula returns #N/A. I tried resaving the workbook, but same result.
You could use an obscure XL4 function, GET.WORKBOOK to return a list of the sheets in the active workbook instead as follows:
Define a range name called "WorksheetNameList" using the formula:
=GET.WORKBOOK(1)
Then, in your Sheet1 use the formula in cell A1:
=MID(INDEX(WorksheetNameList,ROW(A1)),FIND("]",INDEX(WorksheetNameList,ROW(A1)))+1,32)
and then drag the formula down the rows until you hit row 30 (or you obtain a #REF!).
I would not normally recommend using XL4 functions since they could disappear at any time with new Excel releases, but they are used here based on the restriction of your question.
If you'd like more information on what else GET.WORKBOOK can return, please have a look at the help file which is located at http://www.microsoft.com/downloads/details.aspx?FamilyID=c09bf7f7-d30e-4ce9-8930-5d03748ca5cd