I'm creating a sheet for my baby milk consumption and I'm trying to have a sum of the milk drank each day.
Here is a picture of the sheet in question:
Now I don't know how to select the value in column C for each day! Any help is appreciated!
Web Applications Stack Exchange is a question and answer site for power users of web applications. It only takes a minute to sign up.
Sign up to join this communityI'm creating a sheet for my baby milk consumption and I'm trying to have a sum of the milk drank each day.
Here is a picture of the sheet in question:
Now I don't know how to select the value in column C for each day! Any help is appreciated!
If you can repeat the date on every row, use query()
to aggregate the quantities by day. Put this formula in cell E1
or another free range outside of A1:D
:
=query(
A1:D,
"select A, sum(C)
where A is not null
group by A",
0
)
If you cannot repeat the date on each row for some reason, use an array formula to fill the dates down, like this:
=arrayformula( query(
{
if(
row(B1:B) <= max(row(B1:B) * (B1:B <> "")),
iferror(
vlookup(
row(A1:A),
if( len(A1:A), { row(A1:A), A1:A } ),
2,
true
)
),
iferror(1/0)
),
B1:D
},
"select Col1, sum(Col3)
where Col1 is not null
group by Col1",
1
) )
what you could do is
1. Add the date in all cells in Column-a (Ex. 5Mai 2022 from A50 to A55, 6 MAi 2022 form A51 to A63, and so on)
This will solve the issue