For each row in Column C, i'm trying to computer the number of likes divided by the number of posts. For example in C2 cell from day one i divide 5 likes by 1 post, from day 2 i divide 7 likes by 1 post, then in day 3 i divide a sum of (8+1) likes by 2 (total number of posts). As you can see in day 4, the two posts gain some likes, so im trying to compute same from the day before ...like (10+6) likes divide by 2 (total posts).
How do i write my query formula like this based on the sheet below? This is my output of query formula. I already count the unique post id numbers. I was trying to filter and computer data from another sheet :
=QUERY(QUERY(IMPORTRANGE("sheet", "Social media posts!A:AS"),"SELECT Col1, Col14, Col12, Col10, Col23, Col16, Col13, Col37, Col2, Col3 WHERE Col2='instagram'", 1),"SELECT Col1, Col10, COUNT(Col10),SUM(Col2),SUM(Col3), SUM(Col4), SUM(Col5), SUM(Col6), SUM(Col7) group by Col1, Col10")
In the image below, in each post id from Column B, I already counted number of their unique post id #s by each date. Because in the query formula, i group the selections by date in column A. Each of the post id in 8/24/2020 already counted total of 1 in Column C. In column D, I already sum the number of Likes by the number of unique post ids (Column C).
For another one column, in day one 8/24/2020, I want to sum all the values in Column D divided by total # of post id. In day 2 ,08/25/2020, I want to sum all the unique post id's values in Col D including the values from day 1 (8/24 + 8/25) divided by total number of all unique post ids from (8/24 + 8/25)
So what's the correct query formula for this?