Skip to main content
Updated to match OP's edited requirements
Source Link

EDIT

You can try something like:

=sum(filter(C2M2:CM,D2:D="Store 1",A2:A=max(filter(A2:A,B2D2:B="StoreD="Store 1"))))

The inner filter returns every row in A2:A (dates) where B2D2:BD (stores) contains 'Store 1'), we then take the max of this and use it in the outer filter to return every row in C2M2:CM (sales) where A2:A matches that maximum date (and D2:D still contains 'Store 1'), then finally we take the sum of those values.

You can try something like:

=sum(filter(C2:C,A2:A=max(filter(A2:A,B2:B="Store 1"))))

The inner filter returns every row in A2:A (dates) where B2:B (stores) contains 'Store 1'), we then take the max of this and use it in the outer filter to return every row in C2:C (sales) where A2:A matches that maximum, then finally we take the sum of those values.

EDIT

You can try something like:

=sum(filter(M2:M,D2:D="Store 1",A2:A=max(filter(A2:A,D2:D="Store 1"))))

The inner filter returns every row in A2:A (dates) where D2:D (stores) contains 'Store 1'), we then take the max of this and use it in the outer filter to return every row in M2:M (sales) where A2:A matches that maximum date (and D2:D still contains 'Store 1'), then finally we take the sum of those values.

Source Link

You can try something like:

=sum(filter(C2:C,A2:A=max(filter(A2:A,B2:B="Store 1"))))

The inner filter returns every row in A2:A (dates) where B2:B (stores) contains 'Store 1'), we then take the max of this and use it in the outer filter to return every row in C2:C (sales) where A2:A matches that maximum, then finally we take the sum of those values.