How to Add a 2nd Criteria to an Index Match Formula?
I know this has been asked before, but I'm not able to make sense of other people's examples.
Here is a formula I have that works:
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE('[AL DOE.xlsx]DOE'!$L$2:$L$5000,1),'[AL DOE.xlsx]DOE'!$L$2:$L$5000,0))
It looks at the AL DOE sheet and returns the school name (column E) that has the highest percentage of members (column L).
Now I want to have it look for the highest percentage of members among primary schools. This info is in column P.
This is what I tried:
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE('[AL DOE.xlsx]DOE'!$L$2:$L$5000,1),('[AL DOE.xlsx]DOE'!$L$2:$L$5000) * ('[AL DOE.xlsx]DOE'!Primary=$P$2:$P$5000),0))
It gives me a #N/A error. Here is an example of the data:
-------E-------------------------------L-----------------------P
------School--------------------Percent Members----------School Level
John E. Bryan Elem Sch PTA------------84%------------------Primary
Goldsmith Schiffman Elementary PTA----21%------------------Primary
Huntsville Hi Sch PTSA----------------96%--------------------High
Bernice Causey Middle PTSA------------54%-------------------Middle
Hampton Cove Elem PTA-----------------34%------------------Primary
Elsie Collier Elem PTA----------------78%------------------Primary
microsoft-excel worksheet-function
add a comment |
I know this has been asked before, but I'm not able to make sense of other people's examples.
Here is a formula I have that works:
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE('[AL DOE.xlsx]DOE'!$L$2:$L$5000,1),'[AL DOE.xlsx]DOE'!$L$2:$L$5000,0))
It looks at the AL DOE sheet and returns the school name (column E) that has the highest percentage of members (column L).
Now I want to have it look for the highest percentage of members among primary schools. This info is in column P.
This is what I tried:
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE('[AL DOE.xlsx]DOE'!$L$2:$L$5000,1),('[AL DOE.xlsx]DOE'!$L$2:$L$5000) * ('[AL DOE.xlsx]DOE'!Primary=$P$2:$P$5000),0))
It gives me a #N/A error. Here is an example of the data:
-------E-------------------------------L-----------------------P
------School--------------------Percent Members----------School Level
John E. Bryan Elem Sch PTA------------84%------------------Primary
Goldsmith Schiffman Elementary PTA----21%------------------Primary
Huntsville Hi Sch PTSA----------------96%--------------------High
Bernice Causey Middle PTSA------------54%-------------------Middle
Hampton Cove Elem PTA-----------------34%------------------Primary
Elsie Collier Elem PTA----------------78%------------------Primary
microsoft-excel worksheet-function
add a comment |
I know this has been asked before, but I'm not able to make sense of other people's examples.
Here is a formula I have that works:
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE('[AL DOE.xlsx]DOE'!$L$2:$L$5000,1),'[AL DOE.xlsx]DOE'!$L$2:$L$5000,0))
It looks at the AL DOE sheet and returns the school name (column E) that has the highest percentage of members (column L).
Now I want to have it look for the highest percentage of members among primary schools. This info is in column P.
This is what I tried:
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE('[AL DOE.xlsx]DOE'!$L$2:$L$5000,1),('[AL DOE.xlsx]DOE'!$L$2:$L$5000) * ('[AL DOE.xlsx]DOE'!Primary=$P$2:$P$5000),0))
It gives me a #N/A error. Here is an example of the data:
-------E-------------------------------L-----------------------P
------School--------------------Percent Members----------School Level
John E. Bryan Elem Sch PTA------------84%------------------Primary
Goldsmith Schiffman Elementary PTA----21%------------------Primary
Huntsville Hi Sch PTSA----------------96%--------------------High
Bernice Causey Middle PTSA------------54%-------------------Middle
Hampton Cove Elem PTA-----------------34%------------------Primary
Elsie Collier Elem PTA----------------78%------------------Primary
microsoft-excel worksheet-function
I know this has been asked before, but I'm not able to make sense of other people's examples.
Here is a formula I have that works:
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE('[AL DOE.xlsx]DOE'!$L$2:$L$5000,1),'[AL DOE.xlsx]DOE'!$L$2:$L$5000,0))
It looks at the AL DOE sheet and returns the school name (column E) that has the highest percentage of members (column L).
Now I want to have it look for the highest percentage of members among primary schools. This info is in column P.
This is what I tried:
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE('[AL DOE.xlsx]DOE'!$L$2:$L$5000,1),('[AL DOE.xlsx]DOE'!$L$2:$L$5000) * ('[AL DOE.xlsx]DOE'!Primary=$P$2:$P$5000),0))
It gives me a #N/A error. Here is an example of the data:
-------E-------------------------------L-----------------------P
------School--------------------Percent Members----------School Level
John E. Bryan Elem Sch PTA------------84%------------------Primary
Goldsmith Schiffman Elementary PTA----21%------------------Primary
Huntsville Hi Sch PTSA----------------96%--------------------High
Bernice Causey Middle PTSA------------54%-------------------Middle
Hampton Cove Elem PTA-----------------34%------------------Primary
Elsie Collier Elem PTA----------------78%------------------Primary
microsoft-excel worksheet-function
microsoft-excel worksheet-function
asked Jan 14 at 20:36
OzzyKPOzzyKP
93
93
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There appears to be a few different bits going wrong on your new formula but you've almost got it.
The first bit is the LARGE formula; currently it will still be returning 96% as there is nothing on that restricts this function to Primary only. This bit should be something like
LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000' = "Primary", [AL DOE.xlsx]DOE'!$L$2:$L$5000),1)
This says to looks for the largest value in L but only in the rows where P is "Primary". This would now return 84% and feed into your MATCH part of the query but there's an issue there. At he endo fo your formula you currently have:
('[AL DOE.xlsx]DOE'!Primary=$P$2:$P$5000)
when it should be
('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary")
So this would give you a final formula of
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary", '[AL DOE.xlsx]DOE'!$L$2:$L$5000),1), ('[AL DOE.xlsx]DOE'!$L$2:$L$5000) * ('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary"),0))
You also needs this to be an array formula so after typing it in you'll need to press Ctrl, Shift & Enter together
Awesome! That worked! I made two small edits to your final formula (you forgot an apostrophe and forgot to fix the Primary=$P$2:$P$5000 at the end, but otherwise it worked like a charm. Thank you!
– OzzyKP
Jan 15 at 14:34
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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%2fsuperuser.com%2fquestions%2f1394250%2fhow-to-add-a-2nd-criteria-to-an-index-match-formula%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There appears to be a few different bits going wrong on your new formula but you've almost got it.
The first bit is the LARGE formula; currently it will still be returning 96% as there is nothing on that restricts this function to Primary only. This bit should be something like
LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000' = "Primary", [AL DOE.xlsx]DOE'!$L$2:$L$5000),1)
This says to looks for the largest value in L but only in the rows where P is "Primary". This would now return 84% and feed into your MATCH part of the query but there's an issue there. At he endo fo your formula you currently have:
('[AL DOE.xlsx]DOE'!Primary=$P$2:$P$5000)
when it should be
('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary")
So this would give you a final formula of
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary", '[AL DOE.xlsx]DOE'!$L$2:$L$5000),1), ('[AL DOE.xlsx]DOE'!$L$2:$L$5000) * ('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary"),0))
You also needs this to be an array formula so after typing it in you'll need to press Ctrl, Shift & Enter together
Awesome! That worked! I made two small edits to your final formula (you forgot an apostrophe and forgot to fix the Primary=$P$2:$P$5000 at the end, but otherwise it worked like a charm. Thank you!
– OzzyKP
Jan 15 at 14:34
add a comment |
There appears to be a few different bits going wrong on your new formula but you've almost got it.
The first bit is the LARGE formula; currently it will still be returning 96% as there is nothing on that restricts this function to Primary only. This bit should be something like
LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000' = "Primary", [AL DOE.xlsx]DOE'!$L$2:$L$5000),1)
This says to looks for the largest value in L but only in the rows where P is "Primary". This would now return 84% and feed into your MATCH part of the query but there's an issue there. At he endo fo your formula you currently have:
('[AL DOE.xlsx]DOE'!Primary=$P$2:$P$5000)
when it should be
('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary")
So this would give you a final formula of
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary", '[AL DOE.xlsx]DOE'!$L$2:$L$5000),1), ('[AL DOE.xlsx]DOE'!$L$2:$L$5000) * ('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary"),0))
You also needs this to be an array formula so after typing it in you'll need to press Ctrl, Shift & Enter together
Awesome! That worked! I made two small edits to your final formula (you forgot an apostrophe and forgot to fix the Primary=$P$2:$P$5000 at the end, but otherwise it worked like a charm. Thank you!
– OzzyKP
Jan 15 at 14:34
add a comment |
There appears to be a few different bits going wrong on your new formula but you've almost got it.
The first bit is the LARGE formula; currently it will still be returning 96% as there is nothing on that restricts this function to Primary only. This bit should be something like
LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000' = "Primary", [AL DOE.xlsx]DOE'!$L$2:$L$5000),1)
This says to looks for the largest value in L but only in the rows where P is "Primary". This would now return 84% and feed into your MATCH part of the query but there's an issue there. At he endo fo your formula you currently have:
('[AL DOE.xlsx]DOE'!Primary=$P$2:$P$5000)
when it should be
('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary")
So this would give you a final formula of
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary", '[AL DOE.xlsx]DOE'!$L$2:$L$5000),1), ('[AL DOE.xlsx]DOE'!$L$2:$L$5000) * ('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary"),0))
You also needs this to be an array formula so after typing it in you'll need to press Ctrl, Shift & Enter together
There appears to be a few different bits going wrong on your new formula but you've almost got it.
The first bit is the LARGE formula; currently it will still be returning 96% as there is nothing on that restricts this function to Primary only. This bit should be something like
LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000' = "Primary", [AL DOE.xlsx]DOE'!$L$2:$L$5000),1)
This says to looks for the largest value in L but only in the rows where P is "Primary". This would now return 84% and feed into your MATCH part of the query but there's an issue there. At he endo fo your formula you currently have:
('[AL DOE.xlsx]DOE'!Primary=$P$2:$P$5000)
when it should be
('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary")
So this would give you a final formula of
=INDEX('[AL DOE.xlsx]DOE'!$E$2:$E$5000,MATCH(LARGE(IF('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary", '[AL DOE.xlsx]DOE'!$L$2:$L$5000),1), ('[AL DOE.xlsx]DOE'!$L$2:$L$5000) * ('[AL DOE.xlsx]DOE'!$P$2:$P$5000 = "Primary"),0))
You also needs this to be an array formula so after typing it in you'll need to press Ctrl, Shift & Enter together
edited Jan 15 at 14:43
OzzyKP
93
93
answered Jan 15 at 9:01
RickyTillsonRickyTillson
32718
32718
Awesome! That worked! I made two small edits to your final formula (you forgot an apostrophe and forgot to fix the Primary=$P$2:$P$5000 at the end, but otherwise it worked like a charm. Thank you!
– OzzyKP
Jan 15 at 14:34
add a comment |
Awesome! That worked! I made two small edits to your final formula (you forgot an apostrophe and forgot to fix the Primary=$P$2:$P$5000 at the end, but otherwise it worked like a charm. Thank you!
– OzzyKP
Jan 15 at 14:34
Awesome! That worked! I made two small edits to your final formula (you forgot an apostrophe and forgot to fix the Primary=$P$2:$P$5000 at the end, but otherwise it worked like a charm. Thank you!
– OzzyKP
Jan 15 at 14:34
Awesome! That worked! I made two small edits to your final formula (you forgot an apostrophe and forgot to fix the Primary=$P$2:$P$5000 at the end, but otherwise it worked like a charm. Thank you!
– OzzyKP
Jan 15 at 14:34
add a comment |
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f1394250%2fhow-to-add-a-2nd-criteria-to-an-index-match-formula%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