Hello all. I am currently making a model in excel that can return an average number for a specified range of dates/times. There are always numbers that do not exist since the range can differ. When those numbers don't exist and I put them in a formula they should be returning the #VALUE! error. Then I can take the average of the data using a code that takes it while not counting the errors. While this worked the first time I did it, the second time it's returning 0 instead of the error in random places. How do I fix this? I added a picture of it with the formula and affected cells.

Screenshot (10).png