+ Reply to Thread
Results 1 to 13 of 13

From net salary to gross

  1. #1
    Registered User
    Join Date
    11-10-2010
    Location
    china
    MS-Off Ver
    Excel 2003
    Posts
    5

    From net salary to gross

    Hello Everybody,

    I am looking for a formula and am totally stuck. Please help...
    I need to calculate the gross amount of salary of a list of employees that have a net salary guaranteed.

    This is the data :
    Gross - tax = net
    Tax = ((taxable amount * tax rate) - deduction)
    Taxable amount = (gross - 2000)
    Tax rate = 5% if taxable amount is between 0.01 and 500; 10% if between 500.01 and 2000; 15% if between 20001.01 and 5000; 20% if between 5000.01 and 20000;...
    Deduction = 0 if (taxable amount*tax rate) is between 0.01 and 500; 25 if between 500.01 and 2000; 125 if between 20001.01 and 5000; 375 if between 5000.01 and 20000;...

    For the tax rate and the deduction I have been using Vlookups refering to the gross amount, but if I only know my net and have to look for my gross it does not work.

    Hope it is clear and somebody can help

    Blueocean84

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: From net salary to gross

    Have a look at using Goal Seek.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    11-10-2010
    Location
    china
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: From net salary to gross

    Hi Dom,

    Thanks for your quick message. I did and it is working. The problem is that I have a long listing of names and every month the gross will be different. I cannot imagine using goal seek one by one.

    Is there any way I can transform goal seek in a formula?

    Thanks again :-)
    Blueocean84

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: From net salary to gross

    Here's a basic example using a macro to run goal seeks down a list of calculations. I know the calc isn't as complex as the one you're using but the theory is the same.

    Dom
    Attached Files Attached Files
    Last edited by Domski; 11-10-2010 at 10:38 AM.

  5. #5
    Registered User
    Join Date
    11-10-2010
    Location
    china
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: From net salary to gross

    Hello Dom

    That macro would be totally adapted!
    Can I create such a macro without vba? I have never used vba before.

    Thanks again!

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: From net salary to gross

    Hi,

    You can use the macro recorder to produce the code for a single goal seek but it won't help much when it comes to doing anything more complex like running it repeatedly down a column of data.

    I've added some comments to the code to explain what it's doing a bit:

    Please Login or Register  to view this content.

    If you can load up a sample of your workbook with any confidential info changed or removed I don't mind helping to adapt the code to your needs.

    Dom

  7. #7
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: From net salary to gross

    If you want it to the nearest whole number :-

    =SUMPRODUCT(MIN((((ROW(INDIRECT(C9&":"&C1))-((ROW(INDIRECT(C9&":"&C1))-2000)*LOOKUP((ROW(INDIRECT(C9&":"&C1))-2000),{0.01,500,2000,5000,20000},{0.05,0.1,0.15,0.2})-LOOKUP((ROW(INDIRECT(C9&":"&C1))-2000),{0.01,500,2000,5000,20000},{0,25,125,375})))>C9)*1000000)+(ROW(INDIRECT(C9&":"&C1)))))

    Where C1 contains the maximum salary the lower the better but start off at 20000

    and c9 is the target salary!
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  8. #8
    Registered User
    Join Date
    11-10-2010
    Location
    china
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: From net salary to gross

    Hello Dom,

    You are an Angel... :-)

    I will look into the VBA tomorrow morning. I told to myslf many times already I had to start learning.

    Enclosed you will find the actual file. I just started working on it, thus the months after oct are not applicable at all yet.

    Basically the macro needs to run like this :
    - If column C = "local" gross salary guaranteed, so nothing to do
    - If column C = "international" the net salary is guaranteed, which means I need to find back my gross.
    When I run my goal seek I will apply the following : (example line 13).
    Set Cell : U13
    to value : 0
    by changing cell : G13.
    My net( column W) + my tax (column T) will then be equal to my gross.

    Which means I would like to run my goal seek for all lines for which column C is "international"

    I think I have made the table more complicated than i should have been, but it is all I could come up with :-)

    Thank you heeps!
    Blueocean
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: From net salary to gross

    This might be better :-

    =SUMPRODUCT(MIN((((ROW(INDIRECT(E11&":"&(E11*2)))-((ROW(INDIRECT(E11&":"&(E11*2)))-2000)*LOOKUP((ROW(INDIRECT(E11&":"&(E11*2)))-2000),{0.01,500,2000,5000,20000},{0.05,0.1,0.15,0.2})-LOOKUP((ROW(INDIRECT(E11&":"&(E11*2)))-2000),{0.01,500,2000,5000,20000},{0,25,125,375})))<=E11)*1000000)+(ROW(INDIRECT(E11&":"&(E11*2))))))

  10. #10
    Registered User
    Join Date
    11-10-2010
    Location
    china
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: From net salary to gross

    Hi Squiggler47,

    Thanks for the answer, however the right result does not appear.
    I'm not sure I understand every step of your formula, but if I type for example 7779 in target salary, I should have a result of 8142 for the gross salary. With your formual I obtain same as target salary (7779). Did I misunderstand your explanation?

    Btw... thank you so much for your input
    blueocean84

  11. #11
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: From net salary to gross

    It worked for me, here is the sheet I created Target net is the cell to change, above is the working out of your formula from gross to net as a check and it is within 1 unit of the target.

    It works by looping through the values from the NET to 2*NET and working out the net ammount, any value less than NET gets 1000000 added to it, then looking for the minimum value calculated should return the lowest gross that gives a net above or equal to the net you requested!
    Attached Files Attached Files

  12. #12
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: From net salary to gross

    Attached is your workbook with code to perform goal seeks.

    Dom
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-20-2012
    Location
    Lahore
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: From net salary to gross

    Quote Originally Posted by Domski View Post
    Here's a basic example using a macro to run goal seeks down a list of calculations. I know the calc isn't as complex as the one you're using but the theory is the same.

    Dom
    Hi Dom,

    I really appreciate the way you tried to help blueocean. My problem is, when I put formulla in Tax coulmun instead of fixed value, the macro doesn't work . Can you fix this?

    BR
    Muhammad Javed

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

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 Friendly URLs by vBSEO 3.6.0 RC 1