• Global community
• Language:
• Deutsch
• English
• EspaĆ±ol
• FranĆ§ais
• PortuguĆŖs
• ę„ę¬čŖć³ćć„ććć£
Dedicated community for Japanese speakers
• ķźµ­ ģ»¤ė®¤ėķ°
Dedicated community for Korean speakers
Exit Search
• I am wanting help with a form that I have made wit...

# I am wanting help with a form that I have made with my first time using a formula in calculate tab

New Here ,
Jan 25, 2023 Jan 25, 2023

Copied

I have typed in a simplified field notation to calculate (LoanAmt+SeniorLien)/(ApprValue+ApprValue2)*100 This calculation is in a field named LTV I am trying to get it to calculate a loan to value but this field is giving me an error message if the fields for LoanAmt etc don't have a number in them. Error message is "The Value Entered Does Not Match The Format of the Field [LTV]" can someone help me fix this please.

Views

195

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Community Expert , Jan 25, 2023 Jan 25, 2023

That's because if ApprValue and ApprValue2 are empty it try to divide, but you can't divide with zero, so use this as custom calculation script:

var f1 = Number(this.getField("LoanAmt").valueAsString);
var f2 = Number(this.getField("SeniorLien").valueAsString);
var f3 = Number(this.getField("ApprValue").valueAsString);
var f4 = Number(this.getField("ApprValue2").valueAsString);

if(f3||f4)
event.value = (f1+f2)/(f3+f4)*100;
else
event.value = "";

4 Replies 4
Community Expert ,
Jan 25, 2023 Jan 25, 2023

Copied

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post if it helps you get responses.

<moved from using the community>

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Jan 25, 2023 Jan 25, 2023

Copied

I just tried that and It took me to the same place I just posted my question that you replied to

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Expert ,
Jan 25, 2023 Jan 25, 2023

Copied

That's because if ApprValue and ApprValue2 are empty it try to divide, but you can't divide with zero, so use this as custom calculation script:

var f1 = Number(this.getField("LoanAmt").valueAsString);
var f2 = Number(this.getField("SeniorLien").valueAsString);
var f3 = Number(this.getField("ApprValue").valueAsString);
var f4 = Number(this.getField("ApprValue2").valueAsString);

if(f3||f4)
event.value = (f1+f2)/(f3+f4)*100;
else
event.value = "";

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Jan 25, 2023 Jan 25, 2023

Copied

LATEST

Oh My Gosh!!!! Nesa thank you so much, I have been trying to figure this out for several days working on it.

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources