Forum Discussion
NovaNiller
Jan 23, 2024Copper Contributor
Regarding multiple instances of countifs in a formula
Hello 🙂 I'm trying to create a formula, where I have to put multiple instances of countifs in. It currently looks like this: =TÆL.HVISER('Raw data'!D2:D1001;"League";'Raw data'!G2:G1001;...
smylbugti222gmailcom
Jan 23, 2024Iron Contributor
Absolutely! You can add another criteria called "FNM" to your formula using the SUM function and another instance of TÆL.HVISER. Here's how:
Modified formula:
=SUM(TÆL.HVISER('Raw data'!D2:D1001;"League";'Raw data'!G2:G1001;"W"),TÆL.HVISER('Raw data'!D2:D1001;"League";'Raw data'!G2:G1001;"FNM"))
This formula works by:
- Calling TÆL.HVISER twice: Each instance counts the occurrences where the first range ("Raw data'!D2:D1001") equals "League" while the second range ("Raw data'!G2:G1001") matches either "W" or "FNM".
- Wrapping both calls in SUM: This adds the results of both TÆL.HVISER calls, giving you the total count for both "W" and "FNM" matches in the "League" column.
Make sure you enter this formula as an array formula by pressing Ctrl+Shift+Enter instead of just Enter. This is required for formulas containing SUM and multiple ranges.
Here are some additional notes:
- You can add even more criteria by adding more instances of TÆL.HVISER within the SUM function, each with its own specific criteria in the second range.
- If you want to count separately for "W" and "FNM", you can use nested IF statements within each TÆL.HVISER call instead of relying on SUM.
I hope this helps
- NovaNillerJan 24, 2024Copper ContributorHello and thank you for the quick answer 🙂
If I understand your suggestion to the formula correct, then I need to switch it around - I need to count all "W"'s, wether it's "League" or "FNM" 🙂