Wednesday, March 14, 2012

Excel Function To Return The Name of the Worksheet

One of Excel's most useful features is that it allows users to create custom formulas to perform calculations on their data. Excel also contains built-in formulas called functions that make it easy to perform common calculations on data.

Excel's CELL function comes close. The following formula displays the workbook's full path along with the worksheet name:

=CELL("filename")

For example, this formula might return something like:

Excel Function To Return The Name of the Worksheet

D:\Users\IT.TANFAC\Documents\[test.xlsx]Sheet1

Returning only the sheet name requires a more complex formula:

=MID(CELL("filename"), FIND("]",CELL("filename"))+1, LEN(CELL("filename"))-FIND("]", CELL("filename")))

No comments:

Post a Comment