Google Sheets - get the value corresponding to maximum element in another column where the value is non-empty
I have a google spreatsheets for weight on a given date (it's new years). How can I create a formula that will return the non-empty value for the latest date.
A C
2019-01-22
2019-01-15
2019-01-08 200
2019-01-01 191.4
So the result of this will return 200, since 2018-01-08 is the latest date that has a value for C and 200 is that value.
google-sheets
add a comment |
I have a google spreatsheets for weight on a given date (it's new years). How can I create a formula that will return the non-empty value for the latest date.
A C
2019-01-22
2019-01-15
2019-01-08 200
2019-01-01 191.4
So the result of this will return 200, since 2018-01-08 is the latest date that has a value for C and 200 is that value.
google-sheets
add a comment |
I have a google spreatsheets for weight on a given date (it's new years). How can I create a formula that will return the non-empty value for the latest date.
A C
2019-01-22
2019-01-15
2019-01-08 200
2019-01-01 191.4
So the result of this will return 200, since 2018-01-08 is the latest date that has a value for C and 200 is that value.
google-sheets
I have a google spreatsheets for weight on a given date (it's new years). How can I create a formula that will return the non-empty value for the latest date.
A C
2019-01-22
2019-01-15
2019-01-08 200
2019-01-01 191.4
So the result of this will return 200, since 2018-01-08 is the latest date that has a value for C and 200 is that value.
google-sheets
google-sheets
edited Jan 1 at 23:34


Dandelion
409721
409721
asked Jan 1 at 19:10
Micah PearceMicah Pearce
462413
462413
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:
INDIRECT(
ADDRESS(
MATCH(
MAX(
FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
)
,A2:A5)
,2)
)
Note that the ending 2 is the column number of "B".
add a comment |
Please try, for weight:
=index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))
or for date (the 'engine' for above):
=maxifs(A:A,C:C,"<>")
Or, a little shorter:
=VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)
Shorter still, if the sort order can be guaranteed:
=index(filter(C:C,C:C>0),1,1)
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53998202%2fgoogle-sheets-get-the-value-corresponding-to-maximum-element-in-another-column%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:
INDIRECT(
ADDRESS(
MATCH(
MAX(
FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
)
,A2:A5)
,2)
)
Note that the ending 2 is the column number of "B".
add a comment |
Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:
INDIRECT(
ADDRESS(
MATCH(
MAX(
FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
)
,A2:A5)
,2)
)
Note that the ending 2 is the column number of "B".
add a comment |
Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:
INDIRECT(
ADDRESS(
MATCH(
MAX(
FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
)
,A2:A5)
,2)
)
Note that the ending 2 is the column number of "B".
Assuming there is no repeated date in column "A" and also if corresponding values are in column "B" you can use something like:
INDIRECT(
ADDRESS(
MATCH(
MAX(
FILTER(A2:A5,NOT(ISBLANK(B2:B5)))
)
,A2:A5)
,2)
)
Note that the ending 2 is the column number of "B".
edited Jan 1 at 20:10
answered Jan 1 at 19:56


DandelionDandelion
409721
409721
add a comment |
add a comment |
Please try, for weight:
=index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))
or for date (the 'engine' for above):
=maxifs(A:A,C:C,"<>")
Or, a little shorter:
=VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)
Shorter still, if the sort order can be guaranteed:
=index(filter(C:C,C:C>0),1,1)
add a comment |
Please try, for weight:
=index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))
or for date (the 'engine' for above):
=maxifs(A:A,C:C,"<>")
Or, a little shorter:
=VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)
Shorter still, if the sort order can be guaranteed:
=index(filter(C:C,C:C>0),1,1)
add a comment |
Please try, for weight:
=index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))
or for date (the 'engine' for above):
=maxifs(A:A,C:C,"<>")
Or, a little shorter:
=VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)
Shorter still, if the sort order can be guaranteed:
=index(filter(C:C,C:C>0),1,1)
Please try, for weight:
=index(C:C,match(maxifs(A:A,C:C,"<>"),A:A,0))
or for date (the 'engine' for above):
=maxifs(A:A,C:C,"<>")
Or, a little shorter:
=VLOOKUP(maxifs(A:A,C:C,"<>"),A:C,3,0)
Shorter still, if the sort order can be guaranteed:
=index(filter(C:C,C:C>0),1,1)
edited Jan 1 at 21:43
answered Jan 1 at 20:33
pnutspnuts
48.9k763100
48.9k763100
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53998202%2fgoogle-sheets-get-the-value-corresponding-to-maximum-element-in-another-column%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown