Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Need help with verifying data and percentage

1. ## Need help with verifying data and percentage

I am trying to verify a field against another field

field a has a \$ value and field b is a percentage of field a

ie..
1) Field A = \$450,000
Field B should equal 10% of field A

2) Field A = \$450,000
Field C should be between 40% and 90% of field A

What is the best way to achieve this?

sorry!

4. ## Re: Need help with verifying data and percentage

'Percentage calculation
int1 = 450000
int2 = 50
total=int1*(int2/100)
msgbox(total)

For the case where you are validating the range use this to get the lower and upper limits of the percentage and then compare using either &lt; or &gt;.

Cheers~

5. ## Re: Need help with verifying data and percentage

A="\$450,000"
A1=FormatNumber(A,2,,,0)
B1=50

B=FormatPercent(A1*B1/10000) 'With 2 decimal places and comma seperated
msgbox B

B=FormatPercent(A1*B1/10000,0) 'With no decimal places and comma seperated
msgbox B

B=FormatPercent(A1*B1/10000,0,,,0) 'With no decimal places and no comma seperated
msgbox B

The above code will give the value in percentage, then use the comparision operators (&lt;,&lt;=,&gt;,&gt;=) for validating the range.

Thanks,
Amey

6. ## Re: Need help with verifying data and percentage

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.