表中的比较条件

如果总存款表小于总成本表,我想要下面的Excel表 – 它会自动扣除在经理获取表,如果总存款表大于总成本表,它会自动扣除客户获取表。 如果总成本 存款额相等,那么客户获得经理获取表都显示为不到期我非常抱歉,我无法上传excel snap-short图像,因为我的恶名远扬。 但我通过html代码做到了。 澄清我的问题PLZ运行的代码

<!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 2px; } </style> </head> <body> <table style="width:100%"> <tr> <th>Total Cost</th> <th>Total deposit</th> <th>Customer Get</th> <th>Manager Get</th> </tr> <tr> <td>2700</td> <td>2500</td> <td>-</td> <td>-</td> </tr> <tr> <td>2500</td> <td>2900</td> <td>-</td> <td>-</td> </tr> <tr> <td>2300</td> <td>2300</td> <td>-</td> <td>-</td> </tr> </table> </body> </html> 

所以看来你有三个条件:

如果总存款表小于总成本表 – 它自动减去在经理获取表

如果Total Deposit总额大于Total Cost总额 ,则会在Customer Get表中自动扣除

如果总成本总存款额相等,那么客户获得经理获取表都显示为不到期

我相信我们可以使用2个公式来完成。 假设数据从A1开始:

客户获得的公式:

 =IF(B2>A2,B2-A2,IF(B2=A2,"NO Due","-")) 

经理获得公式:

 =IF(B2<A2,A2-B2,IF(B2=A2,"NO Due","-")) 

然后,您可以自动填写公式:

 Total Cost Total deposit Customer Get Manager Get 2700 2500 =IF(B2>A2,B2-A2,IF(B2=A2,"NO Due","-")) =IF(B2<A2,A2-B2,IF(B2=A2,"NO Due","-")) 2500 2900 =IF(B3>A3,B3-A3,IF(B3=A3,"NO Due","-")) =IF(B3<A3,A3-B3,IF(B3=A3,"NO Due","-")) 2300 2300 =IF(B4>A4,B4-A4,IF(B4=A4,"NO Due","-")) =IF(B4<A4,A4-B4,IF(B4=A4,"NO Due","-")) 

结果如下所示:

 Total Cost Total deposit Customer Get Manager Get 2700 2500 - 200 2500 2900 400 - 2300 2300 NO Due NO Due