Excel formula 编写带3个条件的嵌套IF和语句

Excel formula 编写带3个条件的嵌套IF和语句,excel-formula,excel-2010,Excel Formula,Excel 2010,我需要帮助编写嵌套的IF语句。以下是我的条件: 1st condition - if A1 is blank and G1 is blank, return a blank value; 2nd condition - if A1>0 and G1 is blank, return value for E1-A1; Last - if A1>0 and G1>0, return G1-A 我似乎写不出正确的IF和语句。用这个 =IF(A1+G1=0,"",IF(G1=""

我需要帮助编写嵌套的IF语句。以下是我的条件:

1st condition - if A1 is blank and G1 is blank, return a blank value; 
2nd condition - if A1>0 and G1 is blank, return value for E1-A1; 
Last - if A1>0 and G1>0, return G1-A
我似乎写不出正确的IF和语句。

用这个

=IF(A1+G1=0,"",IF(G1="",E1,G1)-A1)

请发布您解决此问题的最新失败尝试。如果G1>0且A1为空怎么办?