2016-10-05 8 views
1

私はExcelの式を決定しようとしていますが、何か間違っている必要があります。私はプログラマではありませんが、ここではロジックです。これは私が今持っている式である:=IF(L30="N",IF(G30>F30,"Overspend","Underspend"),IF(G30>E30,"Overspend","Underspend"))Excelで1つの条件が真であるか2つの異なる条件が偽である場合、2つの列を比較する

If K2 = "False"  
    If G2>F2  
     return overspend 
    Else 
     return underspend 
Else 
    If G2>E2 
     return overspend 
    Else 
     return underspend 
+1

あなたが達成したいことの一般的な考え方は曖昧ですが、この質問にはサンプルデータと期待される結果が役立ちます。 – Jeeped

答えて

0

OR()AND()は素晴らしい機能です。

=IF(OR(AND(K2="N",G2>F2),AND(K2="Y",G2>E2)),"Overspend","Underspend") 

=IF(     -- If 
    OR(    -- either 
    AND(K2="N",G2>F2), -- all of this 
    AND(K2="Y",G2>E2) -- or all of this 
    )     -- is true 
    ,"Overspend"  -- show this 
    ,"Underspend")  -- otherwise show this 
関連する問題