Currently, I’m using a complex countifs() statement:
=countifs($B$2:$B$B1000,"="&L7,'Sheet2'!$C$2:$C$1000,"*")+
countifs($B$2:$B$B1000,"="&L7,'Sheet2'!$D$2:$D$1000,"*")+
countifs($B$2:$B$B1000,"="&L7,'Sheet2'!$E$2:$E$1000,"*")+
countifs($B$2:$B$B1000,"="&L7,'Sheet2'!$F$2:$F$1000,"*")+
countifs($B$2:$B$B1000,"="&L7,'Sheet2'!$G$2:$G$1000,"*")
which is effectively performing a full table scan for each column and is ridiculously slow. There has to be a better way to do this! Suggestions?
What I’m trying to accomplish is counting the number of cells that have something in them for a given dates:
date | Col1 | Col2 | Col3 | Col4 |
---------------------------------------------------
1-Jan | A | A | | A |
1-Jan | A | | | A |
2-Jan | A | | | |
2-Jan | A | A | A | A |
2-Jan | A | | | |
Day | Totals |
-------------------
1-Jan | 5 |
2-Jan | 6 |
Not sure if it will be quicker…..but certainly shorter
=SUMPRODUCT(($B$2:$B1000=L7)*(Sheet2!$C$2:$G$1000<>””))