I would like to do an average between 7 days, the problem is that the information I want the function to look for is 4 rows under one another. Maybe it has something to do with the function rows, or counta ?
The second thing is, that in column B I have dates, on which I had a question yesterday and somebody solved it, so thank you.So now I have one visible date and then 3 same but invisible dates (based on formatting), and I want to look for data in another column (C) which gives me the results from column (D) and makes an average with data from other dates.
So far i was able to come up with this =AVERAGE(AND(LOOKUP(TODAY();B12:B;D12:D);(LOOKUP("kcal";C12:C;D12:D)));(AND(LOOKUP(TODAY()-1;B12:B;D12:D);(LOOKUP("kcal";C12:C;D12:D))))) and then it will continue TODAY()-2,-3....-7.
But this gives me "Can't devide by zero" error
Without the invisible dates it would be easy to do, but then I wouldnt be able to sort it. It would look like this =AVERAGE(LOOKUP(TODAY();B12:B;D12:D);(LOOKUP(TODAY()-1;B12:B;D12:D)))
Link to my fake spreadsheet: https://docs.google.com/spreadsheets/d/1tW8Wi18Ka12l4DNkRYoZdazu5X2MitKqwp38AGVzoVI
Edit: Only possible solution I came up with now was to put in column A values from column D, but only the first value and 4x, now this formula: =AVERAGE(LOOKUP(TODAY();B12:B;A12:A);(LOOKUP(TODAY()-1;B12:B;A12:A));(LOOKUP(TODAY()-2;B12:B;A12:A)); ... till -7 works.Then I can hide with formatting the column A, its not a perfect solution and Im sure there is a better one.