Excel Indirect with Count

后端 未结 1 1047
自闭症患者
自闭症患者 2021-01-20 03:00

I have a workbook with different sheets for each month. I made another sheet where I put the months in A1 down. I wanted to use Counta (for A:A in the months\' sheets) and i

相关标签:
1条回答
  • 2021-01-20 03:45

    Trying out your formula it works perfectly unless you've got a space in the worksheet name. Try this formula:
    =COUNTA(INDIRECT("'" & SheetNames!A1 & "'!A:A"))

    When a sheet name contains a space then the sheet name must be enclosed within apostrophes. So =COUNTA('Sheet 4'!A:A) is a valid formula, while =COUNTA(Sheet 4!A:A) will not work and causes all kinds of problems.
    The INDIRECT formula needs a valid reference as a string (rather than an actual reference) to calculate - so "'" & SheetNames!A1 & "'!A:A" returns the string 'Sheet 4'!A:A.

    0 讨论(0)
提交回复
热议问题