Countif using Loop vs Array

  • Hi All,


    I am creating a sheet where I'll need a couple of SUMIFs and COUNTIFs, so I'm focused on getting the fastest possible way of doing this.


    I have this which works:



    This works fine, but is fairly simplistic. So I thought I'd try an array (a bit of a novice at arrays), to make it faster.



    To my surprise, it takes the same amount of time for both. Am I doing something wrong?

  • Looping in Excel is always going to be slow. With the snippet of information provided above, you should be able to speed this up by writing directly to the range you want to update eg:


  • Looping in Excel is always going to be slow. With the snippet of information provided above, you should be able to speed this up by writing directly to the range you want to update eg:



    Thank you very much!


    I have learnt another way of doing things in VBA.


    This is much much faster


    Thanks again

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!