I am using this formula in Excel VBA to insert the CountIFS()
formula, however the count returned is always 0?
This is the VBA syntax I am using: (I formatted it to add a space after the comma to look better in this window, in my VBA it is all one line)
With ws
.Range("C2:C" & lr).FormulaR1C1 = "=COUNTIFS(Students!C[-2],RC[-2],
Students!C,""<>James"",
Students!C,""<>Joanne"",
Students!C,""<>Lisa"",
Students!C,""<>Marin"",
Students!C,""<>Alfie"",
Students!C,""<>Parent Volunteer"",
Students!C[6],""'Current"")
End with
Which if I look at the formula after the VBA inputs it into the cell it eqates to this:
=COUNTIFS([Students.xlsx]Names!A:A,A2,
[Students.xlsx]Names!C:C,"<>James",
[Students.xlsx]Names!C:C,"<>Joanne",
[Students.xlsx]Names!C:C,"<>Lisa",
[Students.xlsx]Names!C:C,"<>Marin",
[Students.xlsx]Names!C:C,"<>Alfie",
[Students.xlsx]Names!C:C,"<>Parent Volunteer",
[Students.xlsx]Names!I:I,"Current")
Which that looks like the correct syntax. What do I need to change in this syntax in order to have it provide accurate counts?