2017-07-24 149 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

驚人。分解。謝謝。偉大的方式來嵌套論壇。 –