3

I have an Excel workbook with many sheets (today, about thirty, and growing every day). Each worksheet is named for the date of the data it contains (e.g., 02-10, 02-11, etc.). In cell A2 of each worksheet is a number, and I want to write a formula that looks at cell A2 in every worksheet, and returns the largest one.

I created a list of the current worksheets and named it DayWorksheets, and I attempted to get the value using the formula

{=MAX(INDEX(INDIRECT("'"&DayWorksheets&"'!A2"),0))} (brackets shown to denote array formula).

But the result every time is "10," which is the number in cell A2 of the first worksheet in the named range (and it's not the largest). What am I doing wrong here? I've seen a few other formulas around, the likes of

=VLOOKUP(C1,INDIRECT("Sheet"&MATCH(TRUE,COUNTIF(INDIRECT("Sheet"&ROW(INDIRECT("1:10"))&"!A2:A100"),B1)>0,0)&"!A2:B100"),2,0),

but I don't quite understand the purpose of the countif function in there. Any help would be appreciated.

4

1 回答 1

5

您可以像这样使用带有 3D 参考的公式

=MAX(Sheet1:Sheet30!A2)
  1. 单击要输入函数的单元格。
  2. 键入=(等号),输入函数的名称 ( MAX),然后键入左括号。
  3. 单击要引用的第一个工作表的选项卡。
  4. 按住SHIFT并单击要引用的最后一个工作表的选项卡。
  5. 选择要引用的单元格或单元格区域(A2在您的情况下)。
  6. 完成公式(添加右括号),然后按ENTER
于 2014-03-17T20:59:08.723 回答