Jacob Martinez54 said:I'm currently working on an Excel sheet where I need a specific cell to display the product of two previous fields. However, the result shouldn't just be a raw calculation; it needs some logic applied:
* if SUM(c25*d25)=0, show 0
* if SUM(c25*d25) * if SUM(c25*d25)>500, show the actual product
Here is how I tried to write it:
= sum(if(sum(c25*d25)=0;0);if(0500;sum(c25*d25)),
The problem is, whenever c25*d25 is greater than 0 but less than 500, it just spits out 0 instead of 500.
Where did I go wrong? It seems my attempt at defining the range 0div>
Look, the syntax
if functions follow this rule: If(condition; value_if_true; value_if_false).
In all your IF functions, you've only provided the condition and the true value: if(condition; value_if_true). You're missing the "value_if_false" part entirely. Because of that, Excel is just defaulting to 0 when the condition isn't met and cutting off the rest of your formula. In technical terms, what you actually need to do here is nesting the functions.
Try restructuring your formula like this (your original version is a bit of a mess, so use this as a guide to build what you actually need):
if(sum(c25*d25)=0;0;if(AND(sum(c25*d25)>0;sum(c25*d25)500;sum(c25*d25);"Value is less than zero")))