I have a set of values say 38 data points, each data point is category 1 or 2. I need to do a moving average of the last 6 values(from bottom to top so to speak) that have a category of 1. I will not know which category is present for each data point at the time of writing the formula . The user will enter the values one at a time over a long period of time. The moving average needs to update after each input(if relevent, if the correct category is entered)