HP17BII+ - Help with writing Solve Equations...! « Next Oldest | Next Newest »

 ▼ Will Lloyd (UK) Junior Member Posts: 1 Threads: 1 Joined: Jan 1970 03-03-2008, 08:44 AM I have recently bought a 17BII+, superb(having owned a 10B since about 1994). I am grappling with writing a solve equation to calculate net income (after tax) by entering the gross income (before tax). The problem is UK tax has tiers at different rates, for instance 0-£5225 is 0%, next tier is £5226-£7545 at 10% and the next £7546-£39825 at 22% with everything above £39826 at 40%. This has meant that it appears to be a lengthy formula using 'IF' and lots of parentheses. I have tried countless variations and the machine keeps saying "Invalid Equation". Any help/ thoughts please. Many thanks Will ▼ Chris Dean Member Posts: 120 Threads: 9 Joined: Aug 2005 03-03-2008, 09:16 AM My first thought is to check that your left and right parentheses match. Any chance of posting your code? Don Shepherd Posting Freak Posts: 1,392 Threads: 142 Joined: Jun 2007 03-03-2008, 09:35 AM Will, how about this: NET=G*IF(G<5225:0:IF(G<7545:.1:IF(G<39285:.22:.4))) ▼ Bill (Smithville, NJ) Senior Member Posts: 614 Threads: 66 Joined: Jul 2006 03-03-2008, 09:54 AM Hi Will, One method is to calculate the net income at each of the full steps and then add on the amount of net income at the highest bracket. A solver equation to do this is: ```I=IF(G>39825: 32491.4+0.60*(G-39825): IF (G>7545: 7313+0.78*(G-7545): IF (G>5225: 5225+0.90*(G-5225): G))) ``` Bill Don Shepherd Posting Freak Posts: 1,392 Threads: 142 Joined: Jun 2007 03-03-2008, 10:46 AM Actually, I guess that would show tax, not net income. Try this instead: NET=G*IF(G<5225:1:IF(G<7545:.9:IF(G<39825:.78:.6))) ▼ Marcus von Cube, Germany Posting Freak Posts: 3,283 Threads: 104 Joined: Jul 2005 03-03-2008, 10:56 AM Don, I think you are not "slicing" the income correctly. Each tear has its own tax rate. So, if your income is high enough, all tax rates come into play. Since the values for all tears but the highest applicable are constant, these values can be precomputed, as Bill shows in his equation. ▼ Chris Dean Member Posts: 120 Threads: 9 Joined: Aug 2005 03-03-2008, 11:28 AM I think this may be what is required as it slices up the salary. ```INC=G -0.10*IF(G>5225 AND G<7546:G-5225:IF(G>7525:7545-5225:0)) -0.22*IF(G>7545 AND G<39826:G-7545:IF(G>39825:39825-7545:0)) -0.40*IF(G>39825:G-39825:0) ``` I do hasten to add that I wrote this in Notepad and will try it later on my HP17BII+ when I finish work. A refinement would be to use L and G to fix the tax bands for when they change on a periodic basis. Chris Edited out some extra minuses and formatted! Update. I have keyed it in and it does work as expected. Edited: 3 Mar 2008, 12:37 p.m. Don Shepherd Posting Freak Posts: 1,392 Threads: 142 Joined: Jun 2007 03-03-2008, 11:36 AM I see what you mean. Yes, you are right. The US does it differently.

 Possibly Related Threads... Thread Author Replies Views Last Post HP50g: Writing a function that returns a function Chris de Castro 2 690 12-10-2013, 06:49 PM Last Post: Han Writing RPL programs on OS X Sean Freeman 18 1,799 11-30-2013, 03:59 PM Last Post: Sean Freeman [HP Prime] Tips for Solving Differential Equations More Efficiently Chris Pem10 8 994 11-21-2013, 08:25 PM Last Post: Chris Pem10 XCas / Prime "solve" question Nigel J Dowrick 4 735 11-08-2013, 04:01 AM Last Post: Nigel J Dowrick [HP-Prime] - Shortcuts for program writing Jean-Michel 4 680 11-01-2013, 07:55 AM Last Post: Jean-Michel Using the Prime to solve for eigenvalues Michael de Estrada 28 2,970 10-27-2013, 07:21 AM Last Post: Tarcisi C HP Prime Define: Use with solve, etc. Helge Gabert 0 334 10-23-2013, 06:24 PM Last Post: Helge Gabert HP 34s solve f'(x)=0 Richard Berler 8 787 10-07-2013, 03:03 PM Last Post: Dieter HP Prime Solving Nonlinear System of Equations for Complex Results Helge Gabert 11 1,406 09-30-2013, 03:44 AM Last Post: From Hong Kong Good puzzle for kids to solve on 35s? snaggs 11 1,164 09-18-2013, 10:40 PM Last Post: David Hayden

Forum Jump: