Automatically Change Sheet Reference in formula












-1















I have hundreds of sheets, with one master sheet, and I have this formula in my master sheet



=IF(COUNTIF(Sheet2!M$2:M$11,"No")>0, "Y", "N")&COUNTIF(Sheet2!M$2:M$4,"No")&COUNTIF(Sheet2!M$2:M$7,"No")&COUNTIF(Sheet2!M$2:M$11,"No")


which basically grabs the number of yes or nos in a column from the referenced sheet, in this case 'Sheet2', and returns Yes, if there are multiple NOs in the column, and the other arguments just return the count of NOs in the cell ranges.



I just want to drag down the formula in the column it is located in, and have the Sheet reference change from Sheet2 to Sheet3, Sheet4, and so on, but it simply copies it down the column. I've tried looking into it, got some hints with using INDIRECT but I'm returning errors left and right that I'm not sure if I'm on the right track.



EDIT: sample data: https://docs.google.com/spreadsheets/d/1jcbjUs4Ho0LlXF-Olu5NkEw4THqaA0nB5dduYKfx5S8/edit?usp=sharing










share|improve this question

























  • I looked at your data. So cell J3 looks at Sheet3, J4 at Sheet4. Is that the general pattern? So you have as many sheets as there are rows in the sheet "keyword" ?

    – Peter K.
    Nov 27 '18 at 15:17











  • @PeterK. exactly man! Was hoping for a solution that I can just drag down the formula. Been having trouble to easily reference the sheets. EDIT: accidentally pressed enter. I have to create the succeeding sheets first, that will take some time, but it would suck if I had to manually edit the formula to fit "sheet3", "sheet4" and so on in the formula.

    – Mandirigma
    Nov 27 '18 at 15:40













  • See my comment below, but I will formulate in a separate answer.

    – Peter K.
    Nov 27 '18 at 15:41











  • @PeterK. I actually tried that and applied it to my current formula, did not give me errors! But I don't think it was able to reference to the other sheet/s. =IF(COUNTIF(INDIRECT("Sheet" & "!" & M$2:M$11 & ROW()-1),"No")>0, "Y", "N")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")

    – Mandirigma
    Nov 27 '18 at 15:48













  • See the formula in my answer, which is different than what you tried to do. The ROW() just gives you the row number of the formula, so in cell J3 this will give 3. As this references to Sheet2, you have to subtract 1.

    – Peter K.
    Nov 27 '18 at 15:52
















-1















I have hundreds of sheets, with one master sheet, and I have this formula in my master sheet



=IF(COUNTIF(Sheet2!M$2:M$11,"No")>0, "Y", "N")&COUNTIF(Sheet2!M$2:M$4,"No")&COUNTIF(Sheet2!M$2:M$7,"No")&COUNTIF(Sheet2!M$2:M$11,"No")


which basically grabs the number of yes or nos in a column from the referenced sheet, in this case 'Sheet2', and returns Yes, if there are multiple NOs in the column, and the other arguments just return the count of NOs in the cell ranges.



I just want to drag down the formula in the column it is located in, and have the Sheet reference change from Sheet2 to Sheet3, Sheet4, and so on, but it simply copies it down the column. I've tried looking into it, got some hints with using INDIRECT but I'm returning errors left and right that I'm not sure if I'm on the right track.



EDIT: sample data: https://docs.google.com/spreadsheets/d/1jcbjUs4Ho0LlXF-Olu5NkEw4THqaA0nB5dduYKfx5S8/edit?usp=sharing










share|improve this question

























  • I looked at your data. So cell J3 looks at Sheet3, J4 at Sheet4. Is that the general pattern? So you have as many sheets as there are rows in the sheet "keyword" ?

    – Peter K.
    Nov 27 '18 at 15:17











  • @PeterK. exactly man! Was hoping for a solution that I can just drag down the formula. Been having trouble to easily reference the sheets. EDIT: accidentally pressed enter. I have to create the succeeding sheets first, that will take some time, but it would suck if I had to manually edit the formula to fit "sheet3", "sheet4" and so on in the formula.

    – Mandirigma
    Nov 27 '18 at 15:40













  • See my comment below, but I will formulate in a separate answer.

    – Peter K.
    Nov 27 '18 at 15:41











  • @PeterK. I actually tried that and applied it to my current formula, did not give me errors! But I don't think it was able to reference to the other sheet/s. =IF(COUNTIF(INDIRECT("Sheet" & "!" & M$2:M$11 & ROW()-1),"No")>0, "Y", "N")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")

    – Mandirigma
    Nov 27 '18 at 15:48













  • See the formula in my answer, which is different than what you tried to do. The ROW() just gives you the row number of the formula, so in cell J3 this will give 3. As this references to Sheet2, you have to subtract 1.

    – Peter K.
    Nov 27 '18 at 15:52














-1












-1








-1








I have hundreds of sheets, with one master sheet, and I have this formula in my master sheet



=IF(COUNTIF(Sheet2!M$2:M$11,"No")>0, "Y", "N")&COUNTIF(Sheet2!M$2:M$4,"No")&COUNTIF(Sheet2!M$2:M$7,"No")&COUNTIF(Sheet2!M$2:M$11,"No")


which basically grabs the number of yes or nos in a column from the referenced sheet, in this case 'Sheet2', and returns Yes, if there are multiple NOs in the column, and the other arguments just return the count of NOs in the cell ranges.



I just want to drag down the formula in the column it is located in, and have the Sheet reference change from Sheet2 to Sheet3, Sheet4, and so on, but it simply copies it down the column. I've tried looking into it, got some hints with using INDIRECT but I'm returning errors left and right that I'm not sure if I'm on the right track.



EDIT: sample data: https://docs.google.com/spreadsheets/d/1jcbjUs4Ho0LlXF-Olu5NkEw4THqaA0nB5dduYKfx5S8/edit?usp=sharing










share|improve this question
















I have hundreds of sheets, with one master sheet, and I have this formula in my master sheet



=IF(COUNTIF(Sheet2!M$2:M$11,"No")>0, "Y", "N")&COUNTIF(Sheet2!M$2:M$4,"No")&COUNTIF(Sheet2!M$2:M$7,"No")&COUNTIF(Sheet2!M$2:M$11,"No")


which basically grabs the number of yes or nos in a column from the referenced sheet, in this case 'Sheet2', and returns Yes, if there are multiple NOs in the column, and the other arguments just return the count of NOs in the cell ranges.



I just want to drag down the formula in the column it is located in, and have the Sheet reference change from Sheet2 to Sheet3, Sheet4, and so on, but it simply copies it down the column. I've tried looking into it, got some hints with using INDIRECT but I'm returning errors left and right that I'm not sure if I'm on the right track.



EDIT: sample data: https://docs.google.com/spreadsheets/d/1jcbjUs4Ho0LlXF-Olu5NkEw4THqaA0nB5dduYKfx5S8/edit?usp=sharing







google-sheets excel-formula






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 14:55







Mandirigma

















asked Nov 27 '18 at 13:25









MandirigmaMandirigma

147




147













  • I looked at your data. So cell J3 looks at Sheet3, J4 at Sheet4. Is that the general pattern? So you have as many sheets as there are rows in the sheet "keyword" ?

    – Peter K.
    Nov 27 '18 at 15:17











  • @PeterK. exactly man! Was hoping for a solution that I can just drag down the formula. Been having trouble to easily reference the sheets. EDIT: accidentally pressed enter. I have to create the succeeding sheets first, that will take some time, but it would suck if I had to manually edit the formula to fit "sheet3", "sheet4" and so on in the formula.

    – Mandirigma
    Nov 27 '18 at 15:40













  • See my comment below, but I will formulate in a separate answer.

    – Peter K.
    Nov 27 '18 at 15:41











  • @PeterK. I actually tried that and applied it to my current formula, did not give me errors! But I don't think it was able to reference to the other sheet/s. =IF(COUNTIF(INDIRECT("Sheet" & "!" & M$2:M$11 & ROW()-1),"No")>0, "Y", "N")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")

    – Mandirigma
    Nov 27 '18 at 15:48













  • See the formula in my answer, which is different than what you tried to do. The ROW() just gives you the row number of the formula, so in cell J3 this will give 3. As this references to Sheet2, you have to subtract 1.

    – Peter K.
    Nov 27 '18 at 15:52



















  • I looked at your data. So cell J3 looks at Sheet3, J4 at Sheet4. Is that the general pattern? So you have as many sheets as there are rows in the sheet "keyword" ?

    – Peter K.
    Nov 27 '18 at 15:17











  • @PeterK. exactly man! Was hoping for a solution that I can just drag down the formula. Been having trouble to easily reference the sheets. EDIT: accidentally pressed enter. I have to create the succeeding sheets first, that will take some time, but it would suck if I had to manually edit the formula to fit "sheet3", "sheet4" and so on in the formula.

    – Mandirigma
    Nov 27 '18 at 15:40













  • See my comment below, but I will formulate in a separate answer.

    – Peter K.
    Nov 27 '18 at 15:41











  • @PeterK. I actually tried that and applied it to my current formula, did not give me errors! But I don't think it was able to reference to the other sheet/s. =IF(COUNTIF(INDIRECT("Sheet" & "!" & M$2:M$11 & ROW()-1),"No")>0, "Y", "N")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")

    – Mandirigma
    Nov 27 '18 at 15:48













  • See the formula in my answer, which is different than what you tried to do. The ROW() just gives you the row number of the formula, so in cell J3 this will give 3. As this references to Sheet2, you have to subtract 1.

    – Peter K.
    Nov 27 '18 at 15:52

















I looked at your data. So cell J3 looks at Sheet3, J4 at Sheet4. Is that the general pattern? So you have as many sheets as there are rows in the sheet "keyword" ?

– Peter K.
Nov 27 '18 at 15:17





I looked at your data. So cell J3 looks at Sheet3, J4 at Sheet4. Is that the general pattern? So you have as many sheets as there are rows in the sheet "keyword" ?

– Peter K.
Nov 27 '18 at 15:17













@PeterK. exactly man! Was hoping for a solution that I can just drag down the formula. Been having trouble to easily reference the sheets. EDIT: accidentally pressed enter. I have to create the succeeding sheets first, that will take some time, but it would suck if I had to manually edit the formula to fit "sheet3", "sheet4" and so on in the formula.

– Mandirigma
Nov 27 '18 at 15:40







@PeterK. exactly man! Was hoping for a solution that I can just drag down the formula. Been having trouble to easily reference the sheets. EDIT: accidentally pressed enter. I have to create the succeeding sheets first, that will take some time, but it would suck if I had to manually edit the formula to fit "sheet3", "sheet4" and so on in the formula.

– Mandirigma
Nov 27 '18 at 15:40















See my comment below, but I will formulate in a separate answer.

– Peter K.
Nov 27 '18 at 15:41





See my comment below, but I will formulate in a separate answer.

– Peter K.
Nov 27 '18 at 15:41













@PeterK. I actually tried that and applied it to my current formula, did not give me errors! But I don't think it was able to reference to the other sheet/s. =IF(COUNTIF(INDIRECT("Sheet" & "!" & M$2:M$11 & ROW()-1),"No")>0, "Y", "N")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")

– Mandirigma
Nov 27 '18 at 15:48







@PeterK. I actually tried that and applied it to my current formula, did not give me errors! But I don't think it was able to reference to the other sheet/s. =IF(COUNTIF(INDIRECT("Sheet" & "!" & M$2:M$11 & ROW()-1),"No")>0, "Y", "N")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")&COUNTIF(INDIRECT("Sheet" & M$2:M$11 & "!" & ROW()-1),"No")

– Mandirigma
Nov 27 '18 at 15:48















See the formula in my answer, which is different than what you tried to do. The ROW() just gives you the row number of the formula, so in cell J3 this will give 3. As this references to Sheet2, you have to subtract 1.

– Peter K.
Nov 27 '18 at 15:52





See the formula in my answer, which is different than what you tried to do. The ROW() just gives you the row number of the formula, so in cell J3 this will give 3. As this references to Sheet2, you have to subtract 1.

– Peter K.
Nov 27 '18 at 15:52












2 Answers
2






active

oldest

votes


















0














You can replace the Sheet2!M$2:M$11 with the following:
INDIRECT("Sheet"&ROW()-1&"!M$2:M$11")



You have of course to replace the M$2:M$11 with the respective range references.






share|improve this answer
























  • Oh, wow, I was on the right track with my attempt. This worked perfectly my man!

    – Mandirigma
    Nov 27 '18 at 15:51



















1














I have successfully used below formula to count "No's" using a sheet reference from a cell. Try it out:



=IF(COUNTIF(INDIRECT("Sheet" & A1 & "!" & "A:A");"No")>0;"Y";"N")


You can change the column range to suit your need - I just used column "A" in each sheet and cell "A1" with the sheet reference, in the above case A1 contained the number 2 referring to "Sheet2".






share|improve this answer
























  • Hmmm, I;m afraid I might have confused you. my formula at the top works as intended, the only 'problem' I have right now, is I wish I can just easily drag down a column the formula and have Sheet2, automatically change to Sheet3, since each sheet I have contains identical data, in exactly the same rows just that each sheet has a different name.

    – Mandirigma
    Nov 27 '18 at 14:34











  • @Mandirigma But that is what the INDIRECT formula does. In the answer above, if A1 contains 2and A2 contains 3 if you drag down the formula it will search the value on the targeted sheet.

    – Peter K.
    Nov 27 '18 at 14:51











  • @PeterK right, I just mentioned it as a part of a possible solution. But in my spreadsheet,I have mulitple sheets. Let me edit my post with a sample of a part of my data.

    – Mandirigma
    Nov 27 '18 at 14:53











  • could also change A1 to ROW(A1)+1

    – Forward Ed
    Nov 27 '18 at 15:14













  • @ForwardEd I asked OP to further clarify his question. In any case, based on the sample spreadsheet, it should be ROW()-1 . In this case you actually do not need the reference to A1, just to the row of the formula itself is sufficient.

    – Peter K.
    Nov 27 '18 at 15:24













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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53500759%2fautomatically-change-sheet-reference-in-formula%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









0














You can replace the Sheet2!M$2:M$11 with the following:
INDIRECT("Sheet"&ROW()-1&"!M$2:M$11")



You have of course to replace the M$2:M$11 with the respective range references.






share|improve this answer
























  • Oh, wow, I was on the right track with my attempt. This worked perfectly my man!

    – Mandirigma
    Nov 27 '18 at 15:51
















0














You can replace the Sheet2!M$2:M$11 with the following:
INDIRECT("Sheet"&ROW()-1&"!M$2:M$11")



You have of course to replace the M$2:M$11 with the respective range references.






share|improve this answer
























  • Oh, wow, I was on the right track with my attempt. This worked perfectly my man!

    – Mandirigma
    Nov 27 '18 at 15:51














0












0








0







You can replace the Sheet2!M$2:M$11 with the following:
INDIRECT("Sheet"&ROW()-1&"!M$2:M$11")



You have of course to replace the M$2:M$11 with the respective range references.






share|improve this answer













You can replace the Sheet2!M$2:M$11 with the following:
INDIRECT("Sheet"&ROW()-1&"!M$2:M$11")



You have of course to replace the M$2:M$11 with the respective range references.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 27 '18 at 15:49









Peter K.Peter K.

763212




763212













  • Oh, wow, I was on the right track with my attempt. This worked perfectly my man!

    – Mandirigma
    Nov 27 '18 at 15:51



















  • Oh, wow, I was on the right track with my attempt. This worked perfectly my man!

    – Mandirigma
    Nov 27 '18 at 15:51

















Oh, wow, I was on the right track with my attempt. This worked perfectly my man!

– Mandirigma
Nov 27 '18 at 15:51





Oh, wow, I was on the right track with my attempt. This worked perfectly my man!

– Mandirigma
Nov 27 '18 at 15:51













1














I have successfully used below formula to count "No's" using a sheet reference from a cell. Try it out:



=IF(COUNTIF(INDIRECT("Sheet" & A1 & "!" & "A:A");"No")>0;"Y";"N")


You can change the column range to suit your need - I just used column "A" in each sheet and cell "A1" with the sheet reference, in the above case A1 contained the number 2 referring to "Sheet2".






share|improve this answer
























  • Hmmm, I;m afraid I might have confused you. my formula at the top works as intended, the only 'problem' I have right now, is I wish I can just easily drag down a column the formula and have Sheet2, automatically change to Sheet3, since each sheet I have contains identical data, in exactly the same rows just that each sheet has a different name.

    – Mandirigma
    Nov 27 '18 at 14:34











  • @Mandirigma But that is what the INDIRECT formula does. In the answer above, if A1 contains 2and A2 contains 3 if you drag down the formula it will search the value on the targeted sheet.

    – Peter K.
    Nov 27 '18 at 14:51











  • @PeterK right, I just mentioned it as a part of a possible solution. But in my spreadsheet,I have mulitple sheets. Let me edit my post with a sample of a part of my data.

    – Mandirigma
    Nov 27 '18 at 14:53











  • could also change A1 to ROW(A1)+1

    – Forward Ed
    Nov 27 '18 at 15:14













  • @ForwardEd I asked OP to further clarify his question. In any case, based on the sample spreadsheet, it should be ROW()-1 . In this case you actually do not need the reference to A1, just to the row of the formula itself is sufficient.

    – Peter K.
    Nov 27 '18 at 15:24


















1














I have successfully used below formula to count "No's" using a sheet reference from a cell. Try it out:



=IF(COUNTIF(INDIRECT("Sheet" & A1 & "!" & "A:A");"No")>0;"Y";"N")


You can change the column range to suit your need - I just used column "A" in each sheet and cell "A1" with the sheet reference, in the above case A1 contained the number 2 referring to "Sheet2".






share|improve this answer
























  • Hmmm, I;m afraid I might have confused you. my formula at the top works as intended, the only 'problem' I have right now, is I wish I can just easily drag down a column the formula and have Sheet2, automatically change to Sheet3, since each sheet I have contains identical data, in exactly the same rows just that each sheet has a different name.

    – Mandirigma
    Nov 27 '18 at 14:34











  • @Mandirigma But that is what the INDIRECT formula does. In the answer above, if A1 contains 2and A2 contains 3 if you drag down the formula it will search the value on the targeted sheet.

    – Peter K.
    Nov 27 '18 at 14:51











  • @PeterK right, I just mentioned it as a part of a possible solution. But in my spreadsheet,I have mulitple sheets. Let me edit my post with a sample of a part of my data.

    – Mandirigma
    Nov 27 '18 at 14:53











  • could also change A1 to ROW(A1)+1

    – Forward Ed
    Nov 27 '18 at 15:14













  • @ForwardEd I asked OP to further clarify his question. In any case, based on the sample spreadsheet, it should be ROW()-1 . In this case you actually do not need the reference to A1, just to the row of the formula itself is sufficient.

    – Peter K.
    Nov 27 '18 at 15:24
















1












1








1







I have successfully used below formula to count "No's" using a sheet reference from a cell. Try it out:



=IF(COUNTIF(INDIRECT("Sheet" & A1 & "!" & "A:A");"No")>0;"Y";"N")


You can change the column range to suit your need - I just used column "A" in each sheet and cell "A1" with the sheet reference, in the above case A1 contained the number 2 referring to "Sheet2".






share|improve this answer













I have successfully used below formula to count "No's" using a sheet reference from a cell. Try it out:



=IF(COUNTIF(INDIRECT("Sheet" & A1 & "!" & "A:A");"No")>0;"Y";"N")


You can change the column range to suit your need - I just used column "A" in each sheet and cell "A1" with the sheet reference, in the above case A1 contained the number 2 referring to "Sheet2".







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 27 '18 at 14:27









AOlczykAOlczyk

111




111













  • Hmmm, I;m afraid I might have confused you. my formula at the top works as intended, the only 'problem' I have right now, is I wish I can just easily drag down a column the formula and have Sheet2, automatically change to Sheet3, since each sheet I have contains identical data, in exactly the same rows just that each sheet has a different name.

    – Mandirigma
    Nov 27 '18 at 14:34











  • @Mandirigma But that is what the INDIRECT formula does. In the answer above, if A1 contains 2and A2 contains 3 if you drag down the formula it will search the value on the targeted sheet.

    – Peter K.
    Nov 27 '18 at 14:51











  • @PeterK right, I just mentioned it as a part of a possible solution. But in my spreadsheet,I have mulitple sheets. Let me edit my post with a sample of a part of my data.

    – Mandirigma
    Nov 27 '18 at 14:53











  • could also change A1 to ROW(A1)+1

    – Forward Ed
    Nov 27 '18 at 15:14













  • @ForwardEd I asked OP to further clarify his question. In any case, based on the sample spreadsheet, it should be ROW()-1 . In this case you actually do not need the reference to A1, just to the row of the formula itself is sufficient.

    – Peter K.
    Nov 27 '18 at 15:24





















  • Hmmm, I;m afraid I might have confused you. my formula at the top works as intended, the only 'problem' I have right now, is I wish I can just easily drag down a column the formula and have Sheet2, automatically change to Sheet3, since each sheet I have contains identical data, in exactly the same rows just that each sheet has a different name.

    – Mandirigma
    Nov 27 '18 at 14:34











  • @Mandirigma But that is what the INDIRECT formula does. In the answer above, if A1 contains 2and A2 contains 3 if you drag down the formula it will search the value on the targeted sheet.

    – Peter K.
    Nov 27 '18 at 14:51











  • @PeterK right, I just mentioned it as a part of a possible solution. But in my spreadsheet,I have mulitple sheets. Let me edit my post with a sample of a part of my data.

    – Mandirigma
    Nov 27 '18 at 14:53











  • could also change A1 to ROW(A1)+1

    – Forward Ed
    Nov 27 '18 at 15:14













  • @ForwardEd I asked OP to further clarify his question. In any case, based on the sample spreadsheet, it should be ROW()-1 . In this case you actually do not need the reference to A1, just to the row of the formula itself is sufficient.

    – Peter K.
    Nov 27 '18 at 15:24



















Hmmm, I;m afraid I might have confused you. my formula at the top works as intended, the only 'problem' I have right now, is I wish I can just easily drag down a column the formula and have Sheet2, automatically change to Sheet3, since each sheet I have contains identical data, in exactly the same rows just that each sheet has a different name.

– Mandirigma
Nov 27 '18 at 14:34





Hmmm, I;m afraid I might have confused you. my formula at the top works as intended, the only 'problem' I have right now, is I wish I can just easily drag down a column the formula and have Sheet2, automatically change to Sheet3, since each sheet I have contains identical data, in exactly the same rows just that each sheet has a different name.

– Mandirigma
Nov 27 '18 at 14:34













@Mandirigma But that is what the INDIRECT formula does. In the answer above, if A1 contains 2and A2 contains 3 if you drag down the formula it will search the value on the targeted sheet.

– Peter K.
Nov 27 '18 at 14:51





@Mandirigma But that is what the INDIRECT formula does. In the answer above, if A1 contains 2and A2 contains 3 if you drag down the formula it will search the value on the targeted sheet.

– Peter K.
Nov 27 '18 at 14:51













@PeterK right, I just mentioned it as a part of a possible solution. But in my spreadsheet,I have mulitple sheets. Let me edit my post with a sample of a part of my data.

– Mandirigma
Nov 27 '18 at 14:53





@PeterK right, I just mentioned it as a part of a possible solution. But in my spreadsheet,I have mulitple sheets. Let me edit my post with a sample of a part of my data.

– Mandirigma
Nov 27 '18 at 14:53













could also change A1 to ROW(A1)+1

– Forward Ed
Nov 27 '18 at 15:14







could also change A1 to ROW(A1)+1

– Forward Ed
Nov 27 '18 at 15:14















@ForwardEd I asked OP to further clarify his question. In any case, based on the sample spreadsheet, it should be ROW()-1 . In this case you actually do not need the reference to A1, just to the row of the formula itself is sufficient.

– Peter K.
Nov 27 '18 at 15:24







@ForwardEd I asked OP to further clarify his question. In any case, based on the sample spreadsheet, it should be ROW()-1 . In this case you actually do not need the reference to A1, just to the row of the formula itself is sufficient.

– Peter K.
Nov 27 '18 at 15:24




















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53500759%2fautomatically-change-sheet-reference-in-formula%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks