Google Sheets Array Formula how to specify which columns to increment and which not to?











up vote
-1
down vote

favorite
1












I have a google sheet with & columns: ,User,Purchase,Date,billing date which is being populated from a google form.
I want the sum of pending expenses for each user.
Billing date is also specific to user.



So far, I populate column F with last billing date with =MAX(FILTER(D:D, A:A = E2)) and then use this for calculating the pending bill using =IFError(SUM(Filter(C2:C,B2:B>F2,A2:A=E2) ),0)



How do I calculate column F and G using Array Formula?

Link to google sheet: https://docs.google.com/spreadsheets/d/1g6zHXq_p5yX_6vlco1hTyWWt6eC_wSP-9AI5iLWZNnA/edit?usp=sharing










share|improve this question






















  • The problem is that aggregate functions like max and sum cannot be used with arrayformula. Neither can filter, which is itself an arrayformula. If you can write a script, solve your problem that way. Otherwise, there may be formula workarounds, but usually end up with formulas that are unreadable by normal humans!
    – bcperth
    Nov 8 at 3:20















up vote
-1
down vote

favorite
1












I have a google sheet with & columns: ,User,Purchase,Date,billing date which is being populated from a google form.
I want the sum of pending expenses for each user.
Billing date is also specific to user.



So far, I populate column F with last billing date with =MAX(FILTER(D:D, A:A = E2)) and then use this for calculating the pending bill using =IFError(SUM(Filter(C2:C,B2:B>F2,A2:A=E2) ),0)



How do I calculate column F and G using Array Formula?

Link to google sheet: https://docs.google.com/spreadsheets/d/1g6zHXq_p5yX_6vlco1hTyWWt6eC_wSP-9AI5iLWZNnA/edit?usp=sharing










share|improve this question






















  • The problem is that aggregate functions like max and sum cannot be used with arrayformula. Neither can filter, which is itself an arrayformula. If you can write a script, solve your problem that way. Otherwise, there may be formula workarounds, but usually end up with formulas that are unreadable by normal humans!
    – bcperth
    Nov 8 at 3:20













up vote
-1
down vote

favorite
1









up vote
-1
down vote

favorite
1






1





I have a google sheet with & columns: ,User,Purchase,Date,billing date which is being populated from a google form.
I want the sum of pending expenses for each user.
Billing date is also specific to user.



So far, I populate column F with last billing date with =MAX(FILTER(D:D, A:A = E2)) and then use this for calculating the pending bill using =IFError(SUM(Filter(C2:C,B2:B>F2,A2:A=E2) ),0)



How do I calculate column F and G using Array Formula?

Link to google sheet: https://docs.google.com/spreadsheets/d/1g6zHXq_p5yX_6vlco1hTyWWt6eC_wSP-9AI5iLWZNnA/edit?usp=sharing










share|improve this question













I have a google sheet with & columns: ,User,Purchase,Date,billing date which is being populated from a google form.
I want the sum of pending expenses for each user.
Billing date is also specific to user.



So far, I populate column F with last billing date with =MAX(FILTER(D:D, A:A = E2)) and then use this for calculating the pending bill using =IFError(SUM(Filter(C2:C,B2:B>F2,A2:A=E2) ),0)



How do I calculate column F and G using Array Formula?

Link to google sheet: https://docs.google.com/spreadsheets/d/1g6zHXq_p5yX_6vlco1hTyWWt6eC_wSP-9AI5iLWZNnA/edit?usp=sharing







google-sheets array-formulas






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 7 at 21:56









SBob

1




1












  • The problem is that aggregate functions like max and sum cannot be used with arrayformula. Neither can filter, which is itself an arrayformula. If you can write a script, solve your problem that way. Otherwise, there may be formula workarounds, but usually end up with formulas that are unreadable by normal humans!
    – bcperth
    Nov 8 at 3:20


















  • The problem is that aggregate functions like max and sum cannot be used with arrayformula. Neither can filter, which is itself an arrayformula. If you can write a script, solve your problem that way. Otherwise, there may be formula workarounds, but usually end up with formulas that are unreadable by normal humans!
    – bcperth
    Nov 8 at 3:20
















The problem is that aggregate functions like max and sum cannot be used with arrayformula. Neither can filter, which is itself an arrayformula. If you can write a script, solve your problem that way. Otherwise, there may be formula workarounds, but usually end up with formulas that are unreadable by normal humans!
– bcperth
Nov 8 at 3:20




The problem is that aggregate functions like max and sum cannot be used with arrayformula. Neither can filter, which is itself an arrayformula. If you can write a script, solve your problem that way. Otherwise, there may be formula workarounds, but usually end up with formulas that are unreadable by normal humans!
– bcperth
Nov 8 at 3:20












1 Answer
1






active

oldest

votes

















up vote
0
down vote













You need to have a look at the fantastic Query function.



Something similar to this seems to work: =QUERY(A2:D,"select A, max(D), sum(C) group by A") but you will need to nest two queries to get your desired result with the sum.



(note though that in your sheet, you are showing a value for last bill even if a bill hasn't been sent)






share|improve this answer





















  • Yeah that's a default value and it still meets the condition so I might just leave it there I have tried group by A,F as well but that is not producing the write results
    – SBob
    Nov 8 at 14:59













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53198450%2fgoogle-sheets-array-formula-how-to-specify-which-columns-to-increment-and-which%23new-answer', 'question_page');
}
);

Post as a guest
































1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













You need to have a look at the fantastic Query function.



Something similar to this seems to work: =QUERY(A2:D,"select A, max(D), sum(C) group by A") but you will need to nest two queries to get your desired result with the sum.



(note though that in your sheet, you are showing a value for last bill even if a bill hasn't been sent)






share|improve this answer





















  • Yeah that's a default value and it still meets the condition so I might just leave it there I have tried group by A,F as well but that is not producing the write results
    – SBob
    Nov 8 at 14:59

















up vote
0
down vote













You need to have a look at the fantastic Query function.



Something similar to this seems to work: =QUERY(A2:D,"select A, max(D), sum(C) group by A") but you will need to nest two queries to get your desired result with the sum.



(note though that in your sheet, you are showing a value for last bill even if a bill hasn't been sent)






share|improve this answer





















  • Yeah that's a default value and it still meets the condition so I might just leave it there I have tried group by A,F as well but that is not producing the write results
    – SBob
    Nov 8 at 14:59















up vote
0
down vote










up vote
0
down vote









You need to have a look at the fantastic Query function.



Something similar to this seems to work: =QUERY(A2:D,"select A, max(D), sum(C) group by A") but you will need to nest two queries to get your desired result with the sum.



(note though that in your sheet, you are showing a value for last bill even if a bill hasn't been sent)






share|improve this answer












You need to have a look at the fantastic Query function.



Something similar to this seems to work: =QUERY(A2:D,"select A, max(D), sum(C) group by A") but you will need to nest two queries to get your desired result with the sum.



(note though that in your sheet, you are showing a value for last bill even if a bill hasn't been sent)







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 8 at 10:37









a-burge

452511




452511












  • Yeah that's a default value and it still meets the condition so I might just leave it there I have tried group by A,F as well but that is not producing the write results
    – SBob
    Nov 8 at 14:59




















  • Yeah that's a default value and it still meets the condition so I might just leave it there I have tried group by A,F as well but that is not producing the write results
    – SBob
    Nov 8 at 14:59


















Yeah that's a default value and it still meets the condition so I might just leave it there I have tried group by A,F as well but that is not producing the write results
– SBob
Nov 8 at 14:59






Yeah that's a default value and it still meets the condition so I might just leave it there I have tried group by A,F as well but that is not producing the write results
– SBob
Nov 8 at 14:59




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53198450%2fgoogle-sheets-array-formula-how-to-specify-which-columns-to-increment-and-which%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

Schultheiß

Verwaltungsgliederung Dänemarks

Liste der Kulturdenkmale in Wilsdruff