Using blank/not blank in a numeric equation

Has anyone created an equation that adds currency fields if date fields are not blank? According to what I read, blank/not blank can’t be used in an equation?
I have three payment fields and each has a corresponding date field that identifies the date the payment was received. I need to calculate total paid to date by adding the payment fields that have a corresponding date. Anyone have a sample of how you’ve handled this?

May be worth checking this out:

Hi Carl… long time. And thank you for that link on Equations. I’m working another idea. I want to take file, evaluate it and update a second field.
This is my equation:
{Profit %} < 0 ? Loss: ( {Profit %} = 0 ? No Profit: ( {Profit %} > 0 and =< 9.9 ? Minimal: ( {Profit %} >= 10 and < 13 ? Good: ( {Profit %} >= 13 ? Optimal: Investigate: )

Profit % is a calculation field, and the field I want to update with the result is Profit Range. I want the appropriate word Loss, No Profit, Minimal, Good, Optimal, or Investigate displayed in the field. But I get the whole formula displayed.

I’m still barely a novice, but I’m learning, thanks to you and your expert firends. what am I missing?

That’s a lot to unpack :rofl:

On first glance it looks like some of your operators are incorrect. Equals should be == and less than should be <=

Hi @CathyHMcB

You can’t use text in equation fields you would have to substitute numbers then in another field use conditional rules to put text into a short text field or a multiple choice field, depending on the number in your equation field.
Craig

I think I can pull that off! Thanks for the tip.

If you get stuck I’m more than happy to help

1 Like

@CSWinnall - well spotted about using text in the equation. I was too focused on the operators.
@CathyHMcB - It might be worth looking at using a number of conditional rules on a multi choice field.

1 Like

@CarlHolmes @CSWinnall
I’m still not sure I have my operators correct. I’m not getting an error, but I’m not getting expected results. I have a Profit % field which is a calculation (that works great!), but I want to place records with a certain profit in a range. So I created a text formula field called Profit Formula. Here’s the formula
{Profit %} < 0 ? 1: ( {Profit %} == 0 ? 2: ( {Profit %} > 0 and < 10 ? 3: ( {Profit %} >= 10 and < 13 ? 4: ( {Profit %} >= 13 ? 5: 6: ))))
I then followed your advice to create Profit Range that is a multiple choice/one option dropdown to take the output and give it a name of the range it fits into. For instance if Profit % < 0, then it should show Loss. My range field is set up with the verbiage ( Loss, No Profit, Minimal, Good, Optimal, Investigate) in the dropdown list, with 6 conditional rules. If Profit Formula contains 1, set to Loss, etc.
The order of the fields are Profit %, Profit Formula, Profit Range, in case they’re dependent on order.
But the only result I ever get is “Loss” even if the profit is 15%.

Not the best time of day for my old brain but I don’t think you can use “and”, it should be “&” :thinking:

Hi @CathyHMcB

Try this:

{Profit %} < 0 ? 1: ( {Profit %} == 0 ? 2: ( {Profit %} > 0 & {Profit %} < 10 ? 3: ( {Profit %} >= 10 & {Profit %} < 13 ? 4: ( {Profit %} >= 13 ? 5: 6: ))))

You needed to change and to & like Carl said an you were missing some {Profit %} as well. When doing logic you must always put something before the ==, >, <, <=, >= :

Condition A > 0 & Condition B > 10 ? Equation 1 : Equation 2

Craig

Thanks Craig. I made those changes to my text formula field. I understand it, too! Thanks!
But my result is still just a text string, with no result. Plus, my dropdown field isn’t getting updated. Do I have to submit a record before the conditional processing kicks in to update the dropdown field?
Order of fields in the table:
image
Output on my view:

Hi Cathy

The field needs to be an equation field not a text formula field.

Craig

Thanks Craig. So I switched to an equation field. Still working to get it to work. I appreciate you and your help so far. Have a great weekend!

1 Like