Forum Discussion
Emilia_Emcke
Nov 02, 2022Copper Contributor
Count If statement - refer to label name on separate sheet
Hey! I'm trying to create a count if statement that counts all cells in a column on a different sheet with values greater than 4. I need to refer to the column by name, not simply by the array of cel...
- Nov 02, 2022
=SUMPRODUCT((sheet2!$A$1:$I$1="header 2")*(sheet2!$A$2:$I$23>4))You can try this formula.
This is "sheet2":
The formula returns the number of cells from "sheet2" that are under "header 2" and have a value greater 4.
HansVogelaar
Nov 06, 2022MVP
Try
=COUNTIFS(INDEX($A$2:$ZZ$1000, 0, MATCH("Score", $A$1:$ZZ$1, 0)), ">3", INDEX($A$2:$ZZ$1000, 0, MATCH("Teacher", $A$1:$ZZ$1, 0)), "Smith", INDEX($A$1:$ZZ$1000, 0, MATCH("Date", $A$1:$ZZ$1, 0)), ">="&DATE(2022, 1, 1))
Emilia_Emcke
Nov 06, 2022Copper Contributor
Wow!!! That worked thank you so much! One last question, would it also be possible to use a similar formula and return the average of the scores, later than 1/1/2022, and continue to refer to column names?
- HansVogelaarNov 06, 2022MVP
Yes:
=AVERAGEIFS(INDEX($A$2:$ZZ$1000, 0, MATCH("Score", $A$1:$ZZ$1, 0)), INDEX($A$1:$ZZ$1000, 0, MATCH("Date", $A$1:$ZZ$1, 0)), ">="&DATE(2022, 1, 1))
- Emilia_EmckeNov 06, 2022Copper ContributorIs this returning the average of those scores? Would you not have to include some average calculation?
- HansVogelaarNov 06, 2022MVP
Sorry, I meant AVERAGEIFS instead of COUNTIFS. I have edited my previous reply.
- OliverScheurichNov 06, 2022Gold Contributor
=AVERAGEIFS($B$2:$B$11,$C$2:$C$11,G3,$D$2:$D$11,">=44562")You can try this formula which refers to the unique list of teachers. The formula is in cell H3 and copied down in the example.