473,831 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conditional Formula for Computing Commissions

18 New Member
Hi there,

I hope this is simple for someone. I always figure things out myself, but I thought it would be real nice to see if anyone else out there thought this was super simple and knew the answer. Here goes:

I am working on an Access report that details individual sales by month, then sums the total at the bottom (I have all this part done), and based on the sum, uses the appropriate percentage rate to calculate the commission. I hope I am making sense.

Here is the pay rate based on total sales.

0 – 499K = .03%
500k – 999K = .0325%
1M – 1.9M = .035%
2M – 2.9M = .0375%
3M+ = .04%

How do I write a query formula that looks at the total sales and based on the total sales number uses the correct rate to calculate the commission?

Hope this sounds fun for someone. Probably old as the hills.

Thank you and regards,
pollyanna
Oct 14 '07
33 2573
pollyanna
18 New Member
You probably won't know this but the reason I posted so little on this was that it was night-time over here. Mary is not American - she's just a vampire :D Staying up until past 02:00 helping you with your problem (amongst other things).
1) Think comment as comming via Pony Express. I was left will the experience of being taken very good care of; beyond my expectation. I loved the colaboration of inputs from you both. Thank you for being thoughtful about contributing. It's very nice. I like things like that. And, I'll tell you, it is just a fabulous help to someone that is not were you are at, but wants to understand how to make their creation. 1,000 thank youS. :)

2) I have more questions about this formula ya'll helped me with (that Mary made). Here is the formula I settled on and am using:
Expand|Select|Wrap|Line Numbers
  1. =Format(IIf(Sum([Post split]*[OS plan rate])<500000,Sum([Post split]*[OS plan rate]*[OS rate])*0.03,IIf(Sum([Post split]*[OS plan rate])>=500000 And Sum([Post split]*[OS plan rate])<1000000,Sum([Post split]*[OS plan rate]*[OS rate])*0.0325,IIf(Sum([Post split]*[OS plan rate])>=1000000 And Sum([Post split]*[OS plan rate])<2000000,Sum([Post split]*[OS plan rate]*[OS rate])*0.035,IIf(Sum([Post split]*[OS plan rate])>=2000000 And Sum([Post split]*[OS plan rate])<3000000,Sum([Post split]*[OS plan rate]*[OS rate])*0.0375,IIf(Sum([Post split]*[OS plan rate])>=3000000,Sum([Post split]*[OS plan rate]*[OS rate])*0.04))))),"$#,##0.00")
Here are my questions: What if I want to sum this answer by month? What if I want to sum this answer by YTD? What do I add or do? I want to understand what to do. Will you help me more?

cheers!
pollyanna
Nov 25 '07 #31
NeoPa
32,584 Recognized Expert Moderator MVP
Firstly Polyanna, your formula is more complicated than it need be.
Try the following instead. I have posted it with line-breaks for readability and ease of comprehension, but they should be removed when testing this in your database.
As the third parameter of a SQL IIf() call is, by definition, only processed if the condition is found to be False, you needn't check the lower bound of the range again.
Expand|Select|Wrap|Line Numbers
  1. =Format(
  2. IIf(Sum([Post split]*[OS plan rate])<500000,
  3. Sum([Post split]*[OS plan rate]*[OS rate])*0.03,
  4. IIf(Sum([Post split]*[OS plan rate])<1000000,
  5. Sum([Post split]*[OS plan rate]*[OS rate])*0.0325,
  6. IIf(Sum([Post split]*[OS plan rate])<2000000,
  7. Sum([Post split]*[OS plan rate]*[OS rate])*0.035,
  8. IIf(Sum([Post split]*[OS plan rate])<3000000,
  9. Sum([Post split]*[OS plan rate]*[OS rate])*0.0375,
  10. Sum([Post split]*[OS plan rate]*[OS rate])*0.04)))),
  11. "$#,##0.00")
Nov 26 '07 #32
NeoPa
32,584 Recognized Expert Moderator MVP
Just realised this can be tidied up further...
Expand|Select|Wrap|Line Numbers
  1. =Format(
  2. Sum([Post split]*[OS plan rate]*[OS rate])*
  3. IIf(Sum([Post split]*[OS plan rate])<500000,0.03,
  4. IIf(Sum([Post split]*[OS plan rate])<1000000,0.0325,
  5. IIf(Sum([Post split]*[OS plan rate])<2000000,0.035,
  6. IIf(Sum([Post split]*[OS plan rate])<3000000,0.0375,0.04)))),
  7. "$#,##0.00")
Hopefully this is also much easier to read and understand :)
Nov 26 '07 #33
NeoPa
32,584 Recognized Expert Moderator MVP
...
Here are my questions: What if I want to sum this answer by month? What if I want to sum this answer by YTD? What do I add or do? I want to understand what to do. Will you help me more?

cheers!
pollyanna
This is a hard one to answer as I don't know what your dataset contains.
In essence, you need to ensure that the dataset underlying the control is grouped by whichever data you want to group by. In a report this is controlled either by a Filter (if the control is in the Report Header) or by the Sorting and Grouping (if the control is in a sub-header). In a form, this would typically be controlled by a filter.
Nov 26 '07 #34

Sign in to post your reply or Sign up for a free account.

Similar topics

1
14540
by: AMDRIT | last post by:
The stuff below seems to work, when I am applying the logic for suppression. However, it doesn't work when suppressing row data. Any Ideas? Basically, if there is only one row of data, I need to suppress a caption and it corresponding data field. Create a formula field @RowCount Formula Field
2
2933
by: Terry | last post by:
I have a form which displays data from both the Student Details table and the Exam Details table. The Name (Text Box) control is from the Student Details table and the Withdrawn (Check Box) control is from the Exam Details table. I want create an expression, using Conditional Formatting, to change the background colour of the Name (text Box)in the form when the Withdrawn (Check Box) is True.
2
1426
by: RR | last post by:
I am wondering what tables and relationships I would have to have to keep track of one or several employees commissions per transaction. One tracsaction can have one or several employees work on it, and the commissions for each employee depends on how many employees worked on it. Thanks
0
1298
by: Syd | last post by:
The problem i have been asked to solve involves calculating commissions for a multi level marketing company. There are several products SAY A B C D and several Associates (or sellers). The first level of commission has been established. It involves 5 levels of commission. If # of Products sold is about "x" then commission = level 1 for that product.... all the way up to level 5.... This occurs for EVERY product.
2
1469
by: JC | last post by:
I am trying to conditionally print a field on a report based on the value of another field in the query that the report is based on. In the Control Source for SerialB I have typed: = IIF(nz(QtyB) > 0," ",SerialB) On preview of the report I get #Error in that field every time QtyB is NOT greater than 0. If I change the code to read: = IIF(nz(QtyB) > 0," ","9") the blank shows up where it should and the 9 shows up where it should.
1
1302
by: kapccoe | last post by:
Hello how can i adjust formula thru SQLServer?? for example --the computation Gross Salary less Deduction then the total will be for computing of witholdingTax.. thanks pipz..
2
1539
by: patrickahutah | last post by:
I need some help on computing this formula especially the best way to capture the data that is whether to use excel or ms access, then with the data compute the formula. The excercise is for bonus scheme calculation which is depended on various performance indicators. Global Incentive (GI) General Formula GI = {(By-1) * (P/N)} + {X * (COMa-COMm) * (WRpa+UFWpa+CEpa+MRpa+TApa) GI = Global Incentive that relate to the entire company By-1...
30
5719
by: Barry L. Bond | last post by:
Greetings! I just got a new Peet Brothers Ultimeter 2100 Weather Station. This new one has a way to display the heat index, if you press the "dew point" key twice. Being aware of all the controversy surrounding the exact calculation of the heat index, I would like my own software (which I programmed in the 1990's, when I got their Ultimeter 2000 weather station, but that one didn't show heat index) to display it. Living in Florida,...
9
3952
by: menkenk | last post by:
Hello, I have a query that I used to calculate the monthly, quarterly, semi-annual, annual commissions by agent. Below is the SQL view of this Query. SELECT ., .Plan, .Placed, .Monthly, (-7.65)* AS , .Quarterly, (-22.53)* AS , ., (-44.2)* AS , .Annual, (-85)* AS , .CTP, (*) AS FROM INNER JOIN ON .AgentID = .Agent WHERE (((Format())=) AND ((Format(,"mm/yyyy")) Between And )); The issue I have is that under the PLAN field, we have a UL...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10778
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10538
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10210
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5788
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.