A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Dear Carla C,
Good day! Thank you for posting your question in the Microsoft Q&A forum.
We apologize for any inconvenience you may encounter when using our services/ products. Based on your description, some of the issues in your formulation of this equation include the following:
Undefined Variables:
O and SUM are not valid Excel functions or defined names unless you've created named ranges or variables with those names. If not, Excel will throw an error.
Incorrect Use of SUM:
SUM is a function and needs arguments like SUM(A1:A10). Using SUM alone without parentheses or arguments will cause Excel to misinterpret it.
Redundant Logic:
The formula checks both D3<G3 and G3>D3, which are logically the same. This redundancy might not crash Excel, but it’s inefficient.
Kindly try these following steps:
If your goal is to:
- Return a value O when D3 < G3
- Return the sum of something when G3 > D3
- Otherwise return D3 - G3
Then a corrected version might look like:
=IF(D3<G3,"O",IF(G3>D3,SUM(D3,G3),D3-G3))
Or if "O" is just a placeholder and you want to return 0:
=IF(D3<G3,0,IF(G3>D3,SUM(D3,G3),D3-G3))
Tips:
Check for circular references: If this formula is part of a loop or references itself indirectly, it could cause crashes.
Named ranges: Make sure O and SUM aren’t accidentally defined as named ranges pointing to large or invalid areas.
Excel version: Some older versions of Excel may behave unpredictably with malformed formulas.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.