I have a workbook with 4 worksheets:
- Table of Contents
- ABC
- DEF
- GH IJK
I want to count in the table of contents the number of items I have in the other sheets. all the items are in column A so I need to count A:A-1
as you can see I have in column D the items that I should see (I entered them manually) and on column C I tried a formula that worked only on sheets that has one word.
I have a User Defined function that is called Sheet_Name_From_Number()
, I put a number, let's say 2
, and the function returns the name of sheet number 2, in our example it will return ABC
so this is my formula:
=COUNTA(INDIRECT(PERSONAL.XLSB!Sheet_Name_From_Number(A2)&"!A:A"))-1
Here is the formula in cell C2
I'm pretty stuck as I don't know how to count column A from these more than one word sheets. any help will be much appreciated.