2017-07-24 55 views
0

检查了其他几个问题,看不到相同的问题。也许我从错误的角度来看待这个问题。任何帮助或建议表示赞赏。Excel空白单元格中的嵌套IF函数

我有一个包含联系信息工作表,并重新格式化这些第二工作表导入到第三方系统。我正在使用包含'X'的列来挑选那些要迁移的列。我的问题出现在人们提供了一个家庭号码而没有手机号码或反之亦然时,为了导入工作,所有的号码必须在同一列,所以我需要嵌套第二个IF功能,随后询问,如果该单元格是空白的,转到下一个单元格。

基本上合并这两个语句(下面)? - 但不知道如何!

=IF('Master contacts list'!M10="X",'Master contacts list'!H10, IF('Master contacts list'!H10="",'Master contacts list'!J10))

也许我应该使用多个逻辑语句来代替,而是围绕这不能让我的头要么...

回答

0

你接近,你希望你的第二个IF语句是在true第一个if()语句的参数,以便它读取“如果这个单元格包含”x“,那么接下来如果语句做下一个如果语句:如果家庭电话是空白的,然后使用手机号码,否则使用家庭电话号码”

这看起来像:

=IF('Master contacts list'!M10="X", IF('Master contacts list'!H10="",'Master contacts list'!J10, 'Master contacts list'!H10,), "") 
+0

谢谢救了我这么头痛,最终调整了你说的最终公式,看起来像这样: '= IF('主要联系人列表'!M10 =“X”,IF('主要联系人列表'!H10 =“”,“主联系人列表”!J10,“主联系人列表”!H10))' (万一有人搜索具有完全相同的问题) –

0

让我们通过逻辑说话。如果我们应该复制这些数据("X"),并且如果没有家庭号码(=""),请复制单元号。否则如果有家庭电话号码,请复制家庭电话号码。

我觉得它有助于把在单独的行逻辑的各种层次和缩进他们,所以我能理解哪些取决于哪。所以

=IF('Master contacts list'!M10="X", IF('Master contacts list'!H10="",'Master contacts list'!J10, 'Master contacts list'!H10), "") 

所以,如果我们重新格式化该多条线路上

=IF('Master contacts list'!M10="X",  IF I am supposed to copy this data 
    IF('Master contacts list'!H10="",  IF the home phone number is empty 
    'Master contacts list'!J10,   Copy the mobile number 
    'Master contacts list'!H10),   ELSE Copy the home number (since the cell is not empty) 
"")         ELSE make this cell blank (since we weren't supposed to copy the data 

所以场景1:没有 “X”

=IF('Master contacts list'!M10="X",  IF I am supposed to copy this data 
    IF('Master contacts list'!H10="",  IF the home phone number is empty 
    'Master contacts list'!J10,   Copy the mobile number 
    'Master contacts list'!H10),   ELSE Copy the home number (since the cell is not empty) 
"") <<<<<<       ELSE make this cell blank (since we weren't supposed to copy the data 

情形2:有一个 “X” 和有一个家庭电话号码

=IF('Master contacts list'!M10="X",  IF I am supposed to copy this data 
    IF('Master contacts list'!H10="",  IF the home phone number is empty 
    'Master contacts list'!J10,   Copy the mobile number 
    'Master contacts list'!H10),<<<<<<  ELSE Copy the home number (since the cell is not empty) 
"")         ELSE make this cell blank (since we weren't supposed to copy the data 

情景3:T这里是一个“X”,没有手机号码。这是一个黑客,因为如果我们没有一个单元格号码,我们知道我们只有这个逻辑,因为我们没有家庭号码,所以我们只需复制单元格号码。如果它是空白单元格,我们的新电话栏也将为空。

=IF('Master contacts list'!M10="X",  IF I am supposed to copy this data 
    IF('Master contacts list'!H10="",  IF the home phone number is empty 
    'Master contacts list'!J10,<<<<<<  Copy the mobile number 
    'Master contacts list'!H10),   ELSE Copy the home number (since the cell is not empty) 
"")         ELSE make this cell blank (since we weren't supposed to copy the data 

希望有帮助!

+1

惊人。分解。谢谢。伟大的方式来嵌套论坛。 –