Calculating Leftover Percentages

Have you all come across a solution to calculate leftover percentages within certain inputs? Here’s what I’m trying to achieve…

Step #1: User puts in their budget amount
Step #2: User puts in their first invoice percentage amount
Step #3: I want the app to auto-populate the remaining percentage for the second invoice. I know how to get it to populate for the dollar amount… just not the percentages.

12%20PM

The mathematical equation in the “Initial Content” SHOULD be “100%-Input 75%'s value”… but that isn’t working. Thoughts? Workarounds? Or maybe a solution to use something else?

Cheers

My guess is that it doesn’t understand the percent symbol in 100%, so perhaps try 100-input_value or 1-input_value.

Already tried that. The issue is that when you do…

  • 1-Input 75%'s value, you get 100
  • 100-Input 75%'s value, you get 10000

And when either one is used, it instantly shows 100% or 10000% respectively and not the placeholder text of “25%”.

This has to be a basic math equation… but something’s not clicking.

Maybe you want this as a condition, and to only have it applied when other conditions are true?

Also, perhaps instead of using 25% as a placeholder, you actually want that to be the default value. Same goes for the 75%.

Usually, placeholders are used to describe the input (e.g., first name) and then the default value might be the person’s actual name (e.g., John).

Hmmm… ok, I’ll have to read up on “conditions.”

I don’t want the placeholder percentages to be used as the actually inputs because the user may want to split their invoice payments up differently (ie. 50/50, 25/75, 80/20, etc). The placeholder is just for a visual reference.

Appreciate the comments.

Got it.

So, you can use 25% as the placeholder. Then, set a condition: when “input_75’s value is not empty and input_75 is valid” then initial content equal to 1-input_75’s value.

This will show 25% as a placeholder until the user enters a value in the input_75 field.

I’m stepping out for a bit but will get back with this tonight. “…is not empty” is not an option. I’m trying to set this “condition” to the 25% input. If that’s wrong, let me know.

in place of “is not” you’ll also find an option for “is not empty”

Yes, percentages go from 0 to 1. A number formatted as 25.2% is the decimal 0.252.

(It’s the number you’d multiply by to extract that percentage, see?)

(Subtle correction, of course percentages can be greater or less than that, but 0 is 0% and 1 is 100% is my point…)

Thanks for the reply but for whatever reason the “initial content” doesn’t like having “1-” in front of “Input 75%'s value”. Look at images attached… the last image shows what it looks like in the end. The fourth image shows what it looks like live.

Thoughts?

Try this …

first input’s value * -1 + 1

Which is equivalent to

1 - first input’s value

What the OP is trying to do is so hinky. OP, rethink your approach. And read my post. Thanks and you’re welcome.