Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

devide a number over 5 fields

Featured Replies

Hi everybody,

I have a problem witch i can't seem to fix...I hope someone here can help me!

I have 5 loose fields with a purchase price (purchase price1, purchase price2, etc...etc) witch are populated and 5 loose fields with a sale price (sale price1, sale price2, etc...etc) witch are not populated. Next to those fields I have a total saleprice field witch must be higher/same than the sum of the 5 fields with the purchase price.

When I fill in the total sale price field, I want to run a script (or even a caculation in the 5 sale price fields) witch devides the total sale price over the 5 loose sale price fields. But the hard part is that the price that is devided in the loose sale price field may not be lower than the associated purchase price field. The fields are associated by purchase price 1 and sale price 1, purchase price 2 and sale price 2, etc...etc.

Can anybody help here? Please let me know when it is unclear what I'am writing!

greetz & thanx...Jeff

Do you want always want to divide the total-sales price equally on the 5 sales prices numbers (eg, 100 becomes 20+20+20+20+20) and then 'beep' if a salesprice is lower then the corresponding purchase-price, or do you want to make possible other divisions of that number 100 when there is a 'beep'?

The first thing is easy, the latter more difficult. Give an example of what should occur please.

In the first occasion, I think it is not to difficult to set up a field validation by calculation that prevents a total salesprice that is to low being entered.

Harryk

But the hard part is that the price that is devided in the loose sale price field may not be lower than the associated purchase price field.

A single Case calc here, but what should happen then ?

For the rest, validate by calc as Harryk said...

  • Author

salePrice1=Max(total/5,purchasePrice1)

salePrice2=Max((total-purchasePrice1)/4,purchasePrice2)

salePrice3=Max((total-purchasePrice1-purchasePrice2)/3,purchasePrice3)

salePrice4=Max((total-purchasePrice1-purchasePrice2-purchasePrice3)/2,purchasePrice4)

salePrice5=Max(total-purchasePrice1-purchasePrice2-purchasePrice3-purchasePrice4,purchasePrice5)

Dj smirk.gif

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.