Page 1 of 2 12 LastLast
Results 1 to 40 of 57

Thread: SOLVED Basic Math Program BACK AGAIN :(

  1. #1

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Resolved SOLVED Basic Math Program BACK AGAIN :(

    Hello
    I have a program that i need to be able to figure out the tax rate, and then find out how much tax is owed to the customer.

    There are a few tricks when doing this, there are many different shipping rates, that go from 3.95 to 4.95 5.95 etc.
    So what I wanted to do was enter information from the invoice and have it automaticly caluclated.

    Now this is the tricky part, if the customer ordered say 3 parts, i wanted to be able to find out the tax, then have another box where i could put in the price of the part(if they only returned 1 part instead of the whole order), and then have it figure out the tax on just that part.

    Here is some of the data on the invoice:

    Tax Amount .68
    Sales Amount 4.49
    Invioce Amount 9.12

    So the first thing i need the to figure out is how to i figure out what percentage of tax was charged, then have that tax amount * it self by all the different shipping rates.
    Then have another box where i can put in a single part price, and hit calcuate and get the tax on just that part.

    Thanks for the help!
    Last edited by joefox; Jun 9th, 2005 at 09:13 AM.

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Basic Math Program

    *cough*

    http://www.vbforums.com/showthread.php?t=342550

    why didnt you just revive your old thread?...

  3. #3
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    Can you make up numbers and show exactly how you want it to work and how you arrive at your solution. And does it have to be in Visual Basic? From the sounds of it you can do everything here you want in excel, and add more stuff to it, and it would be easier to code and debug in excel in my opinion.
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  4. #4

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Yeah, I have an excel spreed sheet that can do it, but i would rather have a VB program that does it.

  5. #5
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    Can you post the excel sheet and i can get a better look at what you want from the program by chance?
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  6. #6

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Ok, someone returns a part to our warehouse, and i want to figure out how much tax i have to give them back, on the invoice it dosent show what the tax rate was, it was somehow calculated on our bigger mainframe program.

    SO i get the invoice, it shows me the tax amount .68 and the sales amout (this is how much the part totals are) 4.52, and the invoice amount, which is the total of shipping sales amount and shipping and handling.

    So what i want to do is first figure out what the tax rate is.
    Then we have multiple shipping tiers depending on what type of account, we have 3.95 5.95 4.95 6.95 etc

    I want to take that tax amount and figure out how much tax is due upon the shipping cost.

    Then finally, i want to enter how much a single part is (in a seprate box), since there was 2 on the order, 1 part would be 2.26, so i want take that amount, enter it into a seprate box, and hit calcualte and it takes the tax rate and does its calcuation to figure out the tax rate on just that 1 part

  7. #7
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    Ok, So from what i can understand is you have a amount on the invoice for the prices of all items sold to them... and a total cost, which includes the price of all items sold, shipping and handling and tax. You want to take 1 item from that cost and then refund them the price the item costs and the tax they paid for that item? So if there were 2 items at 2.50 each, total 5 before shipping and handling and taxes. The tax Rate is 5% and the shipping and handling is $5.00. So the total would be 10.50 after taxes? Since the tax rate is applied to shipping and handling as well? So they come back to have the 1 item refunded at 2.50. You want to return 2.50 and the 5% tax on it. ( not refunding the shipping and handling charges and the taxes associated with that? ) So you would take the 2.50 + (2.50 * .05) = Refunded Amount? Is that correct?
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  8. #8

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Yes, you almost got it, the thing is, it dosent give me there percetage of tax they were charge it just show me the amount, .63 etc.

    Plus it dosent show me the shipping charges, i have to see what type of account they are and then figure out the tax on the shipping. so i was saying while it calculated the tax, it can also figure out the tax rate found and apply it to the different shipping tiers 4.95 5.95 7.85 12.95 etc. then i can just look down the list and say oh there it is

    But everything else is correct!

  9. #9
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Basic Math Program

    Do they even charge sales tax on the shipping amount? I'm not sure that they do.

  10. #10

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Yep we do, we have to charge tax on the "base price" and our base price is parts + shipping not my rule but company rule lol

  11. #11
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    I did a quick program to illustrate what i think your asking. Im sure thats not all your after... Please explain what else your looking for please. See the attached file.
    Attached Files Attached Files
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  12. #12
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Basic Math Program

    The tax rate should be static. Just divide the amount taxed by the total, and multiply by 100 to get the percentage for the tax. I think I got around 15 whenI tried it earlier.

  13. #13
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    Joe that what you need ?
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  14. #14
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Basic Math Program

    I think he's going to ignore all responses here and just start a 3rd thread to ask the same question once more.

    Then he'll get a new group of people to give him the same answers he got twice before.

  15. #15
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Basic Math Program

    Maybe he's discovered a scheme to defraud the local government out of tax dollars, or a way for someone to profit from excesses paid? I'd check into it. Call the local authorities and ask them how to compute owed taxes.

  16. #16
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    who knows... lol
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  17. #17

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Justin H. Thanks, that is about 95% of what I'm looking to do.

    Now, all i want to do is take that tax % and figure out the tax on the different shipping tiers, so when they hit "Calculate tax" it will calculate the tax on the shipping rates aswell.

    The different shipping rates are:
    4.95, 5.95, 8.95, 10.95, 12.95

  18. #18
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Basic Math Program

    You are refunding the shipping and handling? Not that it matters, as we've said, the tax rate remains the same (static) for all items. Post the figures that you are trying to reproduce, and we will come up with the forumula to let you do it.
    If you can get the right numbers using a calculator, then the app should be able to handle it as well.
    Just posted an example, but I'd like to see actual numbers. Somethig appears to be missing between what you do and what you say you need.

  19. #19

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Look it up, you have to figure out tax on what your "base price is" our base price is part + s&h

  20. #20

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Ok here is the excel spreed sheet I am looking at.

    All that is on this excel spreed sheet the person needs to ender is:

    Invoice
    Sales Amount
    Other (this is the price of the part)

    You see how you dont have to enter the price of the shipping, it just calculates it on all the different shippings? Then you just look to see what type of account they are (we do here) and look at the right shipping.

    Also, i get the correct amount back if i go Sales Amount + Sh to put in the total order box in the program justin made. But you cant calcualte tax like that right?

    here is the file location

    http://www.thefilebucket.com/userfil.../TaxCredit.xls

  21. #21
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    Quote Originally Posted by joefox
    Justin H. Thanks, that is about 95% of what I'm looking to do.

    Now, all i want to do is take that tax % and figure out the tax on the different shipping tiers, so when they hit "Calculate tax" it will calculate the tax on the shipping rates aswell.

    The different shipping rates are:
    4.95, 5.95, 8.95, 10.95, 12.95
    Like that?...
    Attached Files Attached Files
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  22. #22

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Ok now im not sure what program is wrong, the excel spreed sheet, or the VB program.

  23. #23
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    You get your tax percent from total amount sold * amount taxed. So If your total amount sold was just the sales amount and Shipping and handling then yes that would be the correct tax amount. As for which program is right. Im not sure, the differences your getting, how big are they? The program i made uses the tax before its rounded or anything to find the tax on the shipping and handling. So, im not sure which youd want.
    Last edited by Justin H.; Jun 6th, 2005 at 11:56 AM.
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  24. #24
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Basic Math Program

    Quote Originally Posted by joefox
    Ok now im not sure what program is wrong, the excel spreed sheet, or the VB program.
    Don't you have test data and results to base this off of?

    Find an old invoice and use its information to verify...

  25. #25

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Ok here is an old invoice i pulled up. But it dosent show how much was credited because that was no an old system we used that we no longer have access to.

    Part price was 4.49 (only 1 part on order)
    Tax on order was .68
    S&H was 3.95
    Sales amount was 4.49
    Invoice total amount was 9.12


  26. #26
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    and did it work?
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  27. #27

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    I dont know because our old system dosent work anymore, and someone made the excel spreed sheet up.

    So is there a sure way to verify the calcuations are correct?

  28. #28
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    Just use a calculator and then make up some numbers that work, then use them with the excel sheet and see what results you get, then use them with the program see what results you get and then match them up with the calculator to see whos right and which you want to use...
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  29. #29

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Ok its incorrect, the way i check is.
    I take the tax percentage that was calcualted and then * it by the sub total, so it should make .68 tax but it dosent it way less.

    So tax amount was .68
    Then S&H was 3.95
    Sales amount is 4.49
    Invoice amount is 9.12

    SO if i take the the tax % found by the program its: 7.46%
    Then i take that and * it by Sales amount + s&h, this should give me the the tax of .68 cents, but it dosent.

  30. #30

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    I think the excel spreed sheet is wrong, i think it calculates the tax% by adding s&h + sales amount then / by the tax amount. and thats wrong. because you need to figure out the % from the whole invoice amount correct?

    So in excel they have it:
    S&H + Sales Amount / tax

    In the VB Program:
    Invoice AMount / tax
    ' this way seems to be correct

  31. #31
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Basic Math Program

    you're sounding like a broken record....We know how you're checking it.

    Maybe you should explain in better detail what you want. Or possibly post this in the math section of the forums, as this isnt really a programming question.

  32. #32

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    It is a a programing question lol

    If you look at the excel spreed sheet, and you put in the data i put above, it seems that it dosent calculate the tax and the "other" amount correctly.

    I think i got it, thanks!

  33. #33
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    Well If you have it can you please change the title of the post and add the word Resolved and placed a Check box to the title as well
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  34. #34

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Ok well.... lol

    The VB Program calculates it just the same as excel program, but the VB program is always 1 cent higher?

    So checking the equation is always 2 cents higher.

    However, in the excel spreed sheet, it equals out and matches the tax amount on the invoice.
    So maybe i dont need the larger tax % number?
    Last edited by joefox; Jun 6th, 2005 at 03:23 PM.

  35. #35
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    Well that could be because im not taking the rounded version of the tax percent to do the calculations, which, depending on how it was rounded, (up or down) can throw it off a penny. If the invoice is using it the same way as the excel sheet then your numbers will be the same, if you want those results, then you just need to take the rounded version instead of the unrounded version to do your calculations. The program is more accurate, but if compared to another program you do to your invoice theres no way to know. But that would be my guess....
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  36. #36

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Yeah thats how the invoice calc's it.
    So i would use:

    Label3.Caption = TaxPercent ' use this

    OLD

    Holder = Label12.Caption * TaxNumber
    Holder = Format(Holder, "$###.##")
    Label17.Caption = Holder

    NEW

    Holder = Label12.Caption * TaxPercent
    Holder = Format(Holder, "$###.##")
    Label17.Caption = Holder

  37. #37

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    Ah shucks i think i messed it up:
    It gives me an data error

    Here is what i changed it to:

    VB Code:
    1. Dim TaxPercent As String
    2. Dim TaxNumber As String
    3. Dim Refund As String
    4. Dim Holder As String
    5.  
    6. Private Sub Command1_Click()
    7. TaxPercent = Text2.Text / Text1.Text
    8. TaxNumber = TaxPercent
    9. TaxPercent = Format(TaxPercent, "##.##%")
    10. Label3.Caption = TaxPercent
    11. Label6.Caption = TaxNumber
    12.  
    13. Holder = Label12.Caption * TaxPercent ' was taxnumber
    14. Holder = Format(Holder, "$###.##")
    15. Label17.Caption = Holder
    16.  
    17. Holder = Label13.Caption * TaxPercent
    18. Holder = Format(Holder, "$###.##")
    19. Label18.Caption = Holder
    20.  
    21. Holder = Label14.Caption * TaxPercent
    22. Holder = Format(Holder, "$###.##")
    23. Label19.Caption = Holder
    24.  
    25. Holder = Label15.Caption * TaxPercent
    26. Holder = Format(Holder, "$###.##")
    27. Label20.Caption = Holder
    28.  
    29. Holder = Label16.Caption * TaxPercent
    30. Holder = Format(Holder, "$###.##")
    31. Label21.Caption = Holder
    32.  
    33. Holder = Label24(0).Caption * TaxPercent
    34. Holder = Format(Holder, "$###.##")
    35. Label29.Caption = Holder
    36.  
    37. Holder = Label25.Caption * TaxPercent
    38. Holder = Format(Holder, "$###.##")
    39. Label30.Caption = Holder
    40.  
    41. Holder = Label26.Caption * TaxPercent
    42. Holder = Format(Holder, "$###.##")
    43. Label31.Caption = Holder
    44.  
    45. Holder = Label27.Caption * TaxPercent
    46. Holder = Format(Holder, "$###.##")
    47. Label32.Caption = Holder
    48.  
    49. Holder = Label28.Caption * TaxPercent
    50. Holder = Format(Holder, "$###.##")
    51. Label33.Caption = Holder
    52.  
    53. Holder = Label34.Caption * TaxPercent
    54. Holder = Format(Holder, "$###.##")
    55. Label39.Caption = Holder
    56.  
    57. Holder = Label35.Caption * TaxPercent
    58. Holder = Format(Holder, "$###.##")
    59. Label40.Caption = Holder
    60.  
    61. Holder = Label36.Caption * TaxPercent
    62. Holder = Format(Holder, "$###.##")
    63. Label41.Caption = Holder
    64.  
    65. Holder = Label37.Caption * TaxPercent
    66. Holder = Format(Holder, "$###.##")
    67. Label42.Caption = Holder
    68.  
    69. Holder = Label38.Caption * TaxPercent
    70. Holder = Format(Holder, "$###.##")
    71. Label43.Caption = Holder
    72.  
    73. End Sub
    74.  
    75. Private Sub Command2_Click()
    76. Refund = Text3.Text + (Text3.Text * Label6.Caption)
    77. Label10.Caption = Refund
    78. Label8.Caption = Format(Refund, "$######.##")
    79.  
    80. Label23.Caption = Label8.Caption - Text3.Text
    81. End Sub
    82.  
    83. Private Sub Command3_Click()
    84. Text1.Text = ""
    85. Text2.Text = ""
    86. Text3.Text = ""
    87. Label8.Caption = ""
    88. Label3.Caption = ""
    89. Label10.Caption = ""
    90. Label6.Caption = ""
    91. Label23.Caption = ""
    92.  
    93. Label17.Caption = ""
    94. Label18.Caption = ""
    95. Label19.Caption = ""
    96. Label20.Caption = ""
    97. Label21.Caption = ""
    98.  
    99. Label29.Caption = ""
    100. Label30.Caption = ""
    101. Label31.Caption = ""
    102. Label32.Caption = ""
    103. Label33.Caption = ""
    104.  
    105. Label39.Caption = ""
    106. Label40.Caption = ""
    107. Label41.Caption = ""
    108. Label42.Caption = ""
    109. Label43.Caption = ""
    110. End Sub

  38. #38
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    This should do it i think...
    Attached Files Attached Files
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  39. #39
    Lively Member
    Join Date
    May 2005
    Location
    Baltimore, Maryland
    Posts
    118

    Re: Basic Math Program

    you have an error because you are computing with a % in your equations... did you try the program i uploaded?
    Have a Great Day....Hope that helps

    Justin

    • Live
    • Learn
    • Then Use VBCode Brackets and Rate people if it helped you!

  40. #40

    Thread Starter
    Frenzied Member joefox's Avatar
    Join Date
    Oct 2004
    Posts
    1,318

    Re: Basic Math Program

    It still calc's it 1 cent higher

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width