Forum Discussion
COUNTIFS LESS THAN YEAR 2017 does not work when I use "<"&2017
- Jun 23, 2020
Nope, I didn't re-format the data.
You may try alternative formula
=SUMPRODUCT( (Indirect!AI:AI="Agent")*(Indirect!AQ:AQ<"2017")*(Indirect!AR:AR="0"))it's here
plus please check if in main file you have texts or numbers like
I didn't check the file, but it shall be like
=COUNTIFS(Indirect!AI:AI,"Agent",Indirect!AQ:AQ,"<2017",Indirect!AR:AR,0)Sadly I tried that first and it did not work 😞 SergeiBaklan
- SergeiBaklanJun 23, 2020Diamond Contributor
Sorry, was in shortage of time yesterday to check the file carefully.
You keep years Years and EC previously? flag as texts, not as numbers. With using COUNIFS it always converts criteria parameter from text to number if text represents number (or date). Thus you compare as "2007" < 2007 and since any text is always "more" than any number we have zero result. The workaround is to add soften hyphen before such parameters. Thus the formula could be
=COUNTIFS(Indirect!AI:AI,"Agent", Indirect!AQ:AQ,"<"&CHAR(173)&"2017", Indirect!AR:AR,CHAR(173)&"0" )Another option is to use SUMPRODUCT()
- JennyHoA20181Jun 23, 2020Brass Contributor
Thank you! SergeiBaklan Can I ask did you apply any formatting to any of the cells used in the formula? As when I copy your formula across into my latest version excel I still get 0 😞
- SergeiBaklanJun 23, 2020Diamond Contributor
Nope, I didn't re-format the data.
You may try alternative formula
=SUMPRODUCT( (Indirect!AI:AI="Agent")*(Indirect!AQ:AQ<"2017")*(Indirect!AR:AR="0"))it's here
plus please check if in main file you have texts or numbers like