Counting cells of particular color text in various columns in different sheets in the same workbook

前端 未结 2 1200
遇见更好的自我
遇见更好的自我 2021-01-22 00:49

I have a workbook with multiple sheets. One is a MASTER sheet with all of the information with various columns of various pieces of info. There are other sheets that are countin

相关标签:
2条回答
  • 2021-01-22 01:28

    The nice method used by pnuts, Siddarth, Siddarth, relies on two resources:

    1. A method for detecting the text color, =GET.CELL(...).

    2. A method for referencing the appropriate cells, OFFSET(INDIRECT("RC",FALSE),0,-1).

    Regarding #2, there is another option:

    OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,-1)
    

    PS: It gives exactly the same result, and I personally find this use of INDIRECT easier to understand (the other use comes from the legacy XL4, and it is not documented in current versions). I even use similar formulas, sometimes combined with ADDRESS, directly in worksheet cells.

    PS2: This interesting link suggests appending +NOW()*0 to the =GET.CELL(...) formula to ensure automatic recalculation. I found in Excel 2007 it is not needed, for any of the two options for #2 (did I miss something?). It shows also other nice tricks for referring to ranges.

    0 讨论(0)
  • 2021-01-22 01:49

    With two sheets the same (for the example) except Sheet1 without the block showing the count:

    SO20530468 example

    where the formula in F2 shown is:

    =COUNTIF(B:B,D2)+COUNTIF(Sheet1!B:B,D2)   
    

    Courtesy Siddharth Rout.

    Note you would need to save this as .xlsm to preserve the defined name.

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