473,789 Members | 2,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

formula for calculating sales tax (GST)

Hi All

Not sure if this is the right forum, but I need the formula for calculating
the amount of Sales tax (GST) from the tax included price

In Australia GST is 10% and the standard formula is to divide the total by
11 to get the gst amount

This is great until the GST % changes one day

So I need a formula to calculate the amount of GST using the gst% as an
input

I am using VB.net 2005

Any ideas
Regards
Steve
Aug 31 '06 #1
5 39245
Hi Steve

I'm assuming you meant "Divide by 1.1" and not "divide by 11" as that
would appear to make no sense.

If that's the case then something along the following will do the job:
GST = TotalPrice/(1+(GSTPercenta ge/100))

Hope that helps
Martin

steve wrote:
Hi All

Not sure if this is the right forum, but I need the formula for calculating
the amount of Sales tax (GST) from the tax included price

In Australia GST is 10% and the standard formula is to divide the total by
11 to get the gst amount

This is great until the GST % changes one day

So I need a formula to calculate the amount of GST using the gst% as an
input

I am using VB.net 2005

Any ideas
Regards
Steve
Aug 31 '06 #2
Pritcham wrote:
Hi Steve

I'm assuming you meant "Divide by 1.1" and not "divide by 11" as that
would appear to make no sense.

If that's the case then something along the following will do the job:
GST = TotalPrice/(1+(GSTPercenta ge/100))

Hope that helps
Martin

steve wrote:
>Hi All

Not sure if this is the right forum, but I need the formula for calculating
the amount of Sales tax (GST) from the tax included price

In Australia GST is 10% and the standard formula is to divide the total by
11 to get the gst amount

This is great until the GST % changes one day

So I need a formula to calculate the amount of GST using the gst% as an
input

I am using VB.net 2005

Any ideas
Regards
Steve
Guys,

Something has gone screwy here!

Divide by 11 is correct.

The total = net * (1 + tax%/100)
thus
net=total/(1 + tax%/100)

But - be warned, you simply cannot do sales tax this way. Each country
as strict laws which set the amount of decimal places the calculation
has to be correct to (in the UK is it 7). Then there is another set of
rules has to how to round a fractional result, in the UK that is halve
even if memory serves.

So your steps are this:
1) Make sure everything is in double precision - or use a big decimal class
2) Make sure you know the rounding rules
3) Make the calculation in three steps

Kind of like this - but must be tailored to your local laws

const oneHundred as double = 100.0
const one as double = 1.0
const rounder as double = 7.0
function GetTaxFromGross (taxPercent as double, gross as double)
dim tmpd as double
dim tmpl as long
tmpd=gross/(one + taxPercent/oneHundred )
tmpl=clng(tmpd * (rounder + one))
' Better check this - done from memory!
if tmpl mod 20 10 then
if tmpl mod 10 5 then
tmpl=tmpl + 10 -(tmpl mod 10)
else
tmpl=tmpl -(tmpl mod 10)
end if
else
if tmpl mod 10 5 then
tmpl=tmpl -(tmpl mod 10)
else
tmpl=tmpl + 10 -(tmpl mod 10)
end if
end if
return tmpl/rounder
end function

Please pleas please - note this code is a raw translation of the Java
version I wrote a couple of years ago - it is a guideline only - you
must spin your own!

Best wishes

AJ

www.deployview.com
www.nerds-central.com
www.project-network.com
Aug 31 '06 #3
Alex,

Those Britain's are so clever, the Dutch tax rules are more like: Round at
xx and than always in your own benefit.

However probably are the taxes in Britain proud they still have pennies and
no cents, therefore they can still be penny wise and pound foolish.

Please don't see this a serious reply. I could not resist to sent it.

Cor

"Alex Turmer" <at*****@projec t-network.comschr eef in bericht
news:e1******** ******@TK2MSFTN GP06.phx.gbl...
Pritcham wrote:
>Hi Steve

I'm assuming you meant "Divide by 1.1" and not "divide by 11" as that
would appear to make no sense.

If that's the case then something along the following will do the job:
GST = TotalPrice/(1+(GSTPercenta ge/100))

Hope that helps
Martin

steve wrote:
>>Hi All

Not sure if this is the right forum, but I need the formula for
calculating
the amount of Sales tax (GST) from the tax included price

In Australia GST is 10% and the standard formula is to divide the total
by
11 to get the gst amount

This is great until the GST % changes one day

So I need a formula to calculate the amount of GST using the gst% as an
input

I am using VB.net 2005

Any ideas
Regards
Steve
Guys,

Something has gone screwy here!

Divide by 11 is correct.

The total = net * (1 + tax%/100)
thus
net=total/(1 + tax%/100)

But - be warned, you simply cannot do sales tax this way. Each country as
strict laws which set the amount of decimal places the calculation has to
be correct to (in the UK is it 7). Then there is another set of rules has
to how to round a fractional result, in the UK that is halve even if
memory serves.

So your steps are this:
1) Make sure everything is in double precision - or use a big decimal
class
2) Make sure you know the rounding rules
3) Make the calculation in three steps

Kind of like this - but must be tailored to your local laws

const oneHundred as double = 100.0
const one as double = 1.0
const rounder as double = 7.0
function GetTaxFromGross (taxPercent as double, gross as double)
dim tmpd as double
dim tmpl as long
tmpd=gross/(one + taxPercent/oneHundred )
tmpl=clng(tmpd * (rounder + one))
' Better check this - done from memory!
if tmpl mod 20 10 then
if tmpl mod 10 5 then
tmpl=tmpl + 10 -(tmpl mod 10)
else
tmpl=tmpl -(tmpl mod 10)
end if
else
if tmpl mod 10 5 then
tmpl=tmpl -(tmpl mod 10)
else
tmpl=tmpl + 10 -(tmpl mod 10)
end if
end if
return tmpl/rounder
end function

Please pleas please - note this code is a raw translation of the Java
version I wrote a couple of years ago - it is a guideline only - you must
spin your own!

Best wishes

AJ

www.deployview.com
www.nerds-central.com
www.project-network.com

Aug 31 '06 #4
Hi AJ

Thanks for the reply

Just what I wanted

Regards
Steve
"Alex Turmer" <at*****@projec t-network.comwrot e in message
news:e1******** ******@TK2MSFTN GP06.phx.gbl...
Pritcham wrote:
>Hi Steve

I'm assuming you meant "Divide by 1.1" and not "divide by 11" as that
would appear to make no sense.

If that's the case then something along the following will do the job:
GST = TotalPrice/(1+(GSTPercenta ge/100))

Hope that helps
Martin

steve wrote:
>>Hi All

Not sure if this is the right forum, but I need the formula for
calculating
the amount of Sales tax (GST) from the tax included price

In Australia GST is 10% and the standard formula is to divide the total
by
11 to get the gst amount

This is great until the GST % changes one day

So I need a formula to calculate the amount of GST using the gst% as an
input

I am using VB.net 2005

Any ideas
Regards
Steve
Guys,

Something has gone screwy here!

Divide by 11 is correct.

The total = net * (1 + tax%/100)
thus
net=total/(1 + tax%/100)

But - be warned, you simply cannot do sales tax this way. Each country as
strict laws which set the amount of decimal places the calculation has to
be correct to (in the UK is it 7). Then there is another set of rules has
to how to round a fractional result, in the UK that is halve even if
memory serves.

So your steps are this:
1) Make sure everything is in double precision - or use a big decimal
class
2) Make sure you know the rounding rules
3) Make the calculation in three steps

Kind of like this - but must be tailored to your local laws

const oneHundred as double = 100.0
const one as double = 1.0
const rounder as double = 7.0
function GetTaxFromGross (taxPercent as double, gross as double)
dim tmpd as double
dim tmpl as long
tmpd=gross/(one + taxPercent/oneHundred )
tmpl=clng(tmpd * (rounder + one))
' Better check this - done from memory!
if tmpl mod 20 10 then
if tmpl mod 10 5 then
tmpl=tmpl + 10 -(tmpl mod 10)
else
tmpl=tmpl -(tmpl mod 10)
end if
else
if tmpl mod 10 5 then
tmpl=tmpl -(tmpl mod 10)
else
tmpl=tmpl + 10 -(tmpl mod 10)
end if
end if
return tmpl/rounder
end function

Please pleas please - note this code is a raw translation of the Java
version I wrote a couple of years ago - it is a guideline only - you must
spin your own!

Best wishes

AJ

www.deployview.com
www.nerds-central.com
www.project-network.com

Aug 31 '06 #5
Hello Alex,

Other tax laws may apply as well. Like In Homer, AK (where I used to live)
there is a 5.5% sales tax.. but you can only be taxed on the first $500.00
of any single invoice. 3 miles down the road (literally) the tax drops to
2.0%, but the same upper limit applies (so you can't hard-code the max tax,
it has to be the max taxable).

I prefer to enter taxes as a decimal instead of a percentage.. so instead
of entering (or passing) 5.5, I would pass .055.

The formula then becomes..
Gross = Net + (Net * TaxDecimal)

Or in the case of Homer:
Gross = Net + ((Math.Min(MaxT axable, Net) * TaxDecimal) + Math.Max(Net -
MaxTaxable, 0))

Enjoy,
-Boo
Pritcham wrote:
>Hi Steve

I'm assuming you meant "Divide by 1.1" and not "divide by 11" as that
would appear to make no sense.

If that's the case then something along the following will do the
job: GST = TotalPrice/(1+(GSTPercenta ge/100))

Hope that helps
Martin
steve wrote:
>>Hi All

Not sure if this is the right forum, but I need the formula for
calculating the amount of Sales tax (GST) from the tax included
price

In Australia GST is 10% and the standard formula is to divide the
total by 11 to get the gst amount

This is great until the GST % changes one day

So I need a formula to calculate the amount of GST using the gst% as
an input

I am using VB.net 2005

Any ideas

Regards
Steve
Guys,

Something has gone screwy here!

Divide by 11 is correct.

The total = net * (1 + tax%/100)
thus
net=total/(1 + tax%/100)
But - be warned, you simply cannot do sales tax this way. Each
country as strict laws which set the amount of decimal places the
calculation has to be correct to (in the UK is it 7). Then there is
another set of rules has to how to round a fractional result, in the
UK that is halve even if memory serves.

So your steps are this:
1) Make sure everything is in double precision - or use a big decimal
class
2) Make sure you know the rounding rules
3) Make the calculation in three steps
Kind of like this - but must be tailored to your local laws

const oneHundred as double = 100.0
const one as double = 1.0
const rounder as double = 7.0
function GetTaxFromGross (taxPercent as double, gross as double)
dim tmpd as double
dim tmpl as long
tmpd=gross/(one + taxPercent/oneHundred )
tmpl=clng(tmpd * (rounder + one))
' Better check this - done from memory!
if tmpl mod 20 10 then
if tmpl mod 10 5 then
tmpl=tmpl + 10 -(tmpl mod 10)
else
tmpl=tmpl -(tmpl mod 10)
end if
else
if tmpl mod 10 5 then
tmpl=tmpl -(tmpl mod 10)
else
tmpl=tmpl + 10 -(tmpl mod 10)
end if
end if
return tmpl/rounder
end function
Please pleas please - note this code is a raw translation of the Java
version I wrote a couple of years ago - it is a guideline only - you
must spin your own!

Best wishes

AJ

www.deployview.com
www.nerds-central.com
www.project-network.com

Aug 31 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1297
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.
3
5105
by: Mike | last post by:
Hi, I have three tables in the following structure (simplified): Table 1: Containing the customers ------------------------------------------------- create table Customers ( int identity(1, 1) not null, varchar(25) not null
3
2202
by: Wired Hosting News | last post by:
Lets say I have 10 products in 10 different stores and every week I get a report from each store telling me how many items they have left for each of the 10 products. So each week I enter in 100 records with a store number, item number, on hand qty, and date of report into my sales data table. My tables primary is a combo of store# & Item number & Date After 10 week of this I have 1000 record total with ten unique dates.
5
3533
by: Wired Hosting News | last post by:
I tried to be breif and give a scenario so as not to be overlooked because it was soooo long. Let me give you real world. I am a manufacturer of goods and produce 11 items that are distributed to 1800 stores of a national home improvement chain store. Every week I electronicaly receive an excel spreadsheet "inventory report" with 19,800 rows or records, which I import into my tblSalesData table. The table now has 10 weeks of data or...
1
1125
by: mkheys | last post by:
Hi I have a database that I use for tracking ebay sales and profits. My sales table has a form that contains the ebay fees calculation but it won't update the sales table with the results from the formula (formula listed below) =IIf(>1000,(29.375+((-1000)*0.015)),IIf(>75,(3.9375+((-75)*0.0275)),*0.0525)) This formula is working in the form
1
5802
by: Victor | last post by:
Can someone help me with the formula(s) to calculate the RGB components for a gradient from green to red? I'm trying to display a nice graphic with a gradient that reflects the profit or loss and I can calculate the value of red or green at each point based on the value of the profit or loss, but I need to calculate the values of the other 2 colors. Thanks, Victor.
33
2571
by: pollyanna | last post by:
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...
3
1205
by: muddasirmunir | last post by:
i am using vb6 and crystal report 10 with sqlserver 2000 i made a formulal field in crystal report 10 where i had a table name sales , it has two numeric fields credit and debit and give theme a code (slaes.credit)-(sales.debit) +200 and then made a runnnig total of formula field its work fine
6
3429
by: zelmila19 | last post by:
How do i write the formula for calculating the total sales and average for this program: while (sales !=-1) { i <= 12; i++; cout << fixed << setprecision(2) << "Please enter your sales for month " << i << ": "; cin >> sales; } //end while
0
9511
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
10408
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
10139
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
9983
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...
1
7529
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
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.