简体   繁体   English

如果在Excel中跨多个工作表声明

[英]If Statement across multiple sheets in Excel

I have been trying to get this working for the past 2 hours but I am stuck. 我一直试图让这个工作在过去的2个小时,但我被卡住了。

Background: I am doing an audit of our sites and want a Master sheet which shows the health of the audit. 背景:我正在对我们的网站进行审核,并希望获得一张显示审核健康状况的主表。

Problem: I have 4 sheets, 1 called Master and the other 3 called London, Edinburgh and Dublin. 问题:我有4张,1张叫Master,另外3张叫伦敦,爱丁堡和都柏林。 Here is what I am trying to do. 这是我想要做的。

If cell B3 in sheets London, Edinburgh and Dublin has the word yes, I want cell B3 in Master to turn Green. 如果伦敦,爱丁堡和都柏林的单元格B3中有单词yes,我希望Master中的单元格B3变为绿色。 If the 3 sheets have even 1 No, then it should turn yellow and if 2 or more are No then B3 in Master should turn red. 如果3张纸甚至是1号,则它应该变为黄色,如果2张或更多则为“否”,则“主”中的B3应变为红色。

So far I have this and it isn't working. 到目前为止,我有这个,它不起作用。 I cant seem to figure out how to match data in more than 2 sheets, definitely no idea how to do what I described above. 我似乎无法弄清楚如何匹配超过2张数据,绝对不知道如何做我上面描述的。 I believe I need arrays but my excel knowledge is limited. 我相信我需要数组,但我的知识有限。

=IFERROR(IF(MATCH(London!B3 & Edinburgh!B3, Master!$A:$A,0),"yes",),"no")

Would appreciate any help. 非常感谢任何帮助。

Thanks Neha 谢谢Neha

公式选项:

=LOOKUP((London!B3="YES")+(Edinburgh!B3="YES")+(Dublin!B3="YES"),{0,2,3},{"RED","YELLOW","GREEN"})

This is too complicated to do in one cell. 这在一个单元格中太复杂了。 (Yes, you can use a flashy formula, but if you ever want to change it or add a new worksheet, you'll be stuck again.) (是的,您可以使用华而不实的公式,但如果您想要更改它或添加新的工作表,您将再次被卡住。)

Assuming C3 is available on each sheet, put in that cell 假设每张纸都有C3,请放入该单元格

=IF(LOWER(B3)="yes", 1, 0)

Then on your master sheet have a cell that is simply the sum of those cells. 然后在您的主表上有一个单元格,它只是这些单元格的总和。

Conditionally format that master sheet cell, and you're done. 有条件地格式化主表格单元格,您就完成了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM