Share via

Excel - How to select multiple areas as function parameter?

Anonymous
2022-07-01T09:35:46+00:00

Hello,

Let's say I have, for example, these two functions

=COUNTIF(List1!D:D;"Example") + COUNTIF(List2!D:D;"Example")

It would make more sense to write it in one function. But, how do I select multiple areas in the function parameter?

I partially succeeded in this way.

=COUNTIFS(D:D:E:E;"Example")

However, I can only select areas from the sheet itself, unfortunately this entry no longer works.

=COUNTIFS(List1!D:D:List2!D:D;"Example")


Please help

Thank you

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2022-07-01T12:40:01+00:00

Dear MichalRama

If your requirement is to select multiple areas in different sheet, you can add the SUM formula in the formula =SUM(COUNTIFS(INDIRECT({"'P'!D:D";"'R'!D:D"}),"Example")) like the screenshot below:

Sincerely,

Stacey | Microsoft Community Moderator

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-07-01T12:23:24+00:00

    Please try to use the formula =COUNTIFS(INDIRECT({"'P'!D:D";"'R'!D:D"}),"Example") to check if it can work in your end.

    Hello,

    Thanks, but unfortunately this doesn't work either. Excel won't even let me use it because I have to separate the parameters with a semicolon.

    I just forgot to mention that Excel will confirm my entry, but it will only display #SPILL!

    What exactly does that mean please?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-07-01T12:11:33+00:00

    Dear MichalRama

    Please try to use the formula =COUNTIFS(INDIRECT({"'P'!D:D";"'R'!D:D"}),"Example") to check if it can work in your end.

    Sincerely,

    Stacey | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-07-01T11:29:04+00:00

    Hello,

    I already managed to partially figure it out using the INDIRECT function

    =COUNTIFS(INDIRECT("'P'!D:D");"Example")

    The problem is that I didn't understand how to write curly braces for multiple sheets. This doesn't work.

    =COUNTIFS(INDIRECT({"'P'!D:D";"'R'!D:D"});"Example")

    What is the correct entry, please?

    Thank you

    Was this answer helpful?

    0 comments No comments
  4. HansV 462.6K Reputation points
    2022-07-01T11:24:17+00:00

    =COUNTIFS(D:D:E:E;"Example")

    works because D:D:E:E is in fact equal to the single range D:E.

    Functions such as SUMIF, SUMIFS, COUNTIF etc. don't work with multi-sheet references.

    See Count occurrences in entire workbook or a workaround.

    Was this answer helpful?

    0 comments No comments