SUBQUERY equivalent in Google Sheets

Viewed 96

Using a QUERY, I try to calculate the maximum number of pallets registered on the day with the most pallets registered during the month. This column would intitulate "Max day".

LINK of my SpreadSheet : https://docs.google.com/spreadsheets/d/1DkLmJUUFJgnlMD2u-PYcxmPlal-arwrsFNVQ0Q36T_w/edit?usp=sharing

I thought about something like this : QUERY(Days!Ax:Ex;"select max(sum(D)) group by A";-1)

But it prints me an error.

So I imagine a sort of "Select" in a Select (sort of subquery) but I don't know if that exists or the way to go on.

If someone has an answer or another mean to reach my goal it could be very usefull.

Also I tried a PivotTable but I cannot summarize this column "Max day" (I'm also looking for this way).

1 Answers

By this way, you will get the max value per month

=query(query(A3:E;"select C,sum(D),max(A) group by C ");"select Col3,max(Col2) group by Col3")

then you can look for which day ... the problem is that your dates are in Anglo-Saxon and your sheet in FR. Some value are considered as date, some as string! You probably need to align the dates and the locale.

edit

I reconstructed all the dates in FR, all the formulas are under yellow cells https://docs.google.com/spreadsheets/d/11WegOTxespMKP5UDCtxoObk3wStl8MNQezE2e1k_XMk/copy

Related