I have set up a betting worksheet with filters for date start / end, bet type, tipper, sports, leagues and variable.
The issue have that when I come create a formula referencing all of these filters, I get the "You've entered too many arguments in this function." error.
Before adding the Leagues filter, I started off with just date start / end, bet type, tipper, sports and variable filters and I had this formula which was working fine:
=IF(H12<>"",
IF(AND(FILT_D=1,FILT_T=1,FILT_B=1,FILT_C=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P"),
IF(AND(FILT_D>1,FILT_T=1,FILT_B=1,FILT_C=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE)),
IF(AND(FILT_D=1,FILT_T>1,FILT_B=1,FILT_C=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CAPPER,OFFSET(AX$10,FILT_T,0)),
IF(AND(FILT_D=1,FILT_T=1,FILT_B>1,FILT_C=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_TYPE,OFFSET(AW$10,FILT_B,0)),
IF(AND(FILT_D=1,FILT_T=1,FILT_B=1,FILT_C>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D>1,FILT_T>1,FILT_B=1,FILT_C=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CAPPER,OFFSET(AX$10,FILT_T,0)),
IF(AND(FILT_D>1,FILT_T=1,FILT_B>1,FILT_C=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),BET_TYPE,OFFSET(AW$10,FILT_B,0)),
IF(AND(FILT_D>1,FILT_T=1,FILT_B=1,FILT_C>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D=1,FILT_T>1,FILT_B>1,FILT_C=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CAPPER,OFFSET(AX$10,FILT_T,0),BET_TYPE,OFFSET(AW$10,FILT_B,0)),
IF(AND(FILT_D=1,FILT_T>1,FILT_B=1,FILT_C>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CAPPER,OFFSET(AX$10,FILT_T,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D=1,FILT_T=1,FILT_B>1,FILT_C>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D>1,FILT_T>1,FILT_B>1,FILT_C=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CAPPER,OFFSET(AX$10,FILT_T,0),BET_TYPE,OFFSET(AW$10,FILT_B,0)),
IF(AND(FILT_D=1,FILT_T>1,FILT_B>1,FILT_C>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CAPPER,OFFSET(AX$10,FILT_T,0),BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D>1,FILT_T=1,FILT_B>1,FILT_C>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D>1,FILT_T>1,FILT_B=1,FILT_C>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CAPPER,OFFSET(AX$10,FILT_T,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D>1,FILT_T>1,FILT_B>1,FILT_C>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CAPPER,OFFSET(AX$10,FILT_T,0),BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
"")))))))))))))))),
"")
I then added a league filter into the mix and got the error. This is the amended formula containing the league filter (FILT_T).
=IF(P12<>"",
IF(AND(FILT_D=1,FILT_T=1,FILT_B=1,FILT_C=1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P"),
IF(AND(FILT_D>1,FILT_T=1,FILT_B=1,FILT_C=1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE)),
IF(AND(FILT_D=1,FILT_T>1,FILT_B=1,FILT_C=1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CAPPER,OFFSET(AX$10,FILT_T,0)),
IF(AND(FILT_D=1,FILT_T=1,FILT_B>1,FILT_C=1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_TYPE,OFFSET(AW$10,FILT_B,0)),
IF(AND(FILT_D=1,FILT_T=1,FILT_B=1,FILT_C>1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D=1,FILT_T=1,FILT_B=1,FILT_C=1,FILT_L>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",LEAGUES,OFFSET(AZ$10,FILT_L,0)),
IF(AND(FILT_D>1,FILT_T>1,FILT_B=1,FILT_C=1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CAPPER,OFFSET(AX$10,FILT_T,0)),
IF(AND(FILT_D>1,FILT_T=1,FILT_B>1,FILT_C=1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),BET_TYPE,OFFSET(AW$10,FILT_B,0)),
IF(AND(FILT_D>1,FILT_T=1,FILT_B=1,FILT_C>1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D>1,FILT_T=1,FILT_B=1,FILT_C=1,FILT_L>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),LEAGUES,OFFSET(AZ$10,FILT_L,0)),
IF(AND(FILT_D=1,FILT_T>1,FILT_B>1,FILT_C=1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CAPPER,OFFSET(AX$10,FILT_T,0),BET_TYPE,OFFSET(AW$10,FILT_B,0)),
IF(AND(FILT_D=1,FILT_T>1,FILT_B=1,FILT_C>1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CAPPER,OFFSET(AX$10,FILT_T,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D=1,FILT_T>1,FILT_B=1,FILT_C=1,FILT_L>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CAPPER,OFFSET(AX$10,FILT_T,0),LEAGUES,OFFSET(AZ$10,FILT_L,0)),
IF(AND(FILT_D=1,FILT_T=1,FILT_B>1,FILT_C>1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D=1,FILT_T=1,FILT_B>1,FILT_C=1,FILT_L>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_TYPE,OFFSET(AW$10,FILT_B,0),LEAGUES,OFFSET(AZ$10,FILT_L,0)),
IF(AND(FILT_D>1,FILT_T>1,FILT_B>1,FILT_C=1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CAPPER,OFFSET(AX$10,FILT_T,0),BET_TYPE,OFFSET(AW$10,FILT_B,0)),
IF(AND(FILT_D=1,FILT_T>1,FILT_B>1,FILT_C>1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",CAPPER,OFFSET(AX$10,FILT_T,0),BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D=1,FILT_T=1,FILT_B>1,FILT_C>1,FILT_L>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0),LEAGUES,OFFSET(AZ$10,FILT_L,0)),
IF(AND(FILT_D>1,FILT_T=1,FILT_B>1,FILT_C>1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D>1,FILT_T=1,FILT_B>1,FILT_C>1,FILT_L>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0),LEAGUES,OFFSET(AZ$10,FILT_L,0)),
IF(AND(FILT_D>1,FILT_T>1,FILT_B=1,FILT_C>1,FILT_L=1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CAPPER,OFFSET(AX$10,FILT_T,0),CUSTOM,OFFSET(AY$10,FILT_C,0)),
IF(AND(FILT_D>1,FILT_T>1,FILT_B=1,FILT_C>1,FILT_L>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CAPPER,OFFSET(AX$10,FILT_T,0),CUSTOM,OFFSET(AY$10,FILT_C,0),LEAGUES,OFFSET(AZ$10,FILT_L,0)),
IF(AND(FILT_D>1,FILT_T>1,FILT_B>1,FILT_C>1,FILT_L>1),SUMIFS(AT_RISK,SPORT,H12,WIN,"<>P",BET_DATE,">="&DATE(OFFSET(BA$11,FILT_YS,0),FILT_MS,FILT_DS),BET_DATE,"<="&DATE(OFFSET(BA$11,FILT_YE,0),FILT_ME,FILT_DE),CAPPER,OFFSET(AX$10,FILT_T,0),BET_TYPE,OFFSET(AW$10,FILT_B,0),CUSTOM,OFFSET(AY$10,FILT_C,0),LEAGUES,OFFSET(AZ$10,FILT_L,0)),
"")))))))))))))))))))))),
"")
Can anyone shed light on what I'm doing wrong?
You can only have a maximum of 255 cell referenced or indeed numbers referred to in a formula. The following has 255 ones and it works fine, adding an additional one will give you the error
=IF(AND(1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1);"t";"f")