How to reference data from another sheet in a conditional formula in google docs

◇◆丶佛笑我妖孽 提交于 2019-12-12 05:11:48

问题


I have multiple spreadsheets in a single google doc and I am trying to use information from one spread sheet in a conditional formula. For example, if the document contained two spreadsheets (sheet_A and sheet_B), I am trying to create a conditional formula such that if there is text in sheet_A cell A2, then sheet_B cell A2 fills a certain color.

I have tried Apply to range = B2 and creating a custom formula =sheet_A!A2<>"". However, I keep getting an error that this is an invalid formula. I can use =sheet_A!A2 to pull the value from the other sheet and the formula =A2<>"" works for conditional formatting to change the color within the same sheet, I just can't seem to get these two functions to act together.

Many thanks for any thoughts on what I am doing wrong here.


回答1:


For some reason conditional formatting requires the INDIRECT function.

Try this as your custom formula:

=INDIRECT("sheet_A!A2")<>""




回答2:


You could use istext or len > 0 for your conditional also:

=LEN(INDIRECT("'Sheet2'!A2"))>0

OR

=ISTEXT(INDIRECT("'Sheet2'!A2"))


来源:https://stackoverflow.com/questions/37633643/how-to-reference-data-from-another-sheet-in-a-conditional-formula-in-google-docs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!