简体   繁体   English

Excel 公式帮助:在确定两个单元格之一是否填充数据后,将数据从一个工作表复制到另一个工作表

[英]Excel Formula Help: Copying data from one worksheet to another after determining if one of two cells is populated with data

I have a need to combining several excel worksheets into a single Master list.我需要将多个 Excel 工作表合并到一个主列表中。 I'm stuck trying to populate a cell in my worksheet with one of 2 values from another worksheet (Staging_2) in the same workbook.我一直在尝试使用同一工作簿中另一个工作表 (Staging_2) 的 2 个值之一填充工作表中的单元格。

This formula, originating from my master worksheet, needs to look at cell C2 in the Staging_2 worksheet and determine if it's has data in it.这个公式源自我的主工作表,需要查看 Staging_2 工作表中的单元格 C2 并确定它是否包含数据。 If it does, I want to copy everything in that cell to my master worksheet.如果是这样,我想将该单元格中的所有内容复制到我的主工作表中。 If Staging_2 cell C2 is blank, I want to copy the value from Staging_2, cell B2 to the Master worksheet.如果 Staging_2 单元格 C2 为空,我想将 Staging_2 单元格 B2 中的值复制到主工作表。

NOTE: the option to use VB code is not available to me, so it has to be some sort of formula注意:使用 VB 代码的选项对我不可用,所以它必须是某种公式

I can easily map cells, and have even used the mid formula to find specific information in another area, but I cant figure out how to compare 2 cells on a different worksheet and take one value if it's populated, or another if it's not.我可以轻松映射单元格,甚至使用中间公式在另一个区域查找特定信息,但我无法弄清楚如何比较不同工作表上的 2 个单元格并在填充时取一个值,否则取另一个值。

I don't see why an IF statement couldn't get the job done, however without images or examples it is difficult to know what you need to do.我不明白为什么 IF 语句无法完成工作,但是如果没有图像或示例,很难知道您需要做什么。

=IF(Staging_2!C2<>"",Staging_2!C2,Staging_2!B2)

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

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