Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

SalesTax ( Taxable ; Exempt ; Rate ; Method ; Start )

Rate this function:  

  Average rating: 4.4  (13 votes)
  Discuss this Custom Function

Jeep Watson, Uptown Press

Calculate Sales Tax

Sample Input:
Ohio - SalesTax ( 8.40 ; 0 ; .0675 ; "R" ; .08 )
Maryland - SalesTax ( 10.75 ; 0 ; .06 ; "C" ; .20 )
Texas - SalesTax ( 11.59 ; 0 ; .0825 ; "R" ; .07 )
Texas - SalesTax ( 11.59 ; 1 ; .0825 ; "R" ; .07 )
Sample Output:

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed


I've written software for several retail clients in my home state of Maryland. In 2008
Maryland raised its Retail Sales Tax from 5% to 6%. The 5% rate was relatively easy
to do with a simple calculation. Not so with the 6% rate. Multiplying a subtotal by 6%
(.06) results in fractional cents. I tried using the Round function in Filemaker,
thinking that would be an equitable solution but the results did not line up with the
state's published tax chart. Rather than spending more time on figuring out the math
behind Maryland's chart, I decided to make the calculation a simple lookup table. It
took less than 20 lines of code, was easy to write, and was plenty quick enough.

Recently I was tuning up some older custom functions and thought it might be a
good idea to create a custom function for calculating Sales Tax. Nice and portable
and easy to implement in new applications. I posted the function on Brian Dunning's
site for others to use. In a couple of days I got a response from Michael Horak
(Comment, as he is known on various Filemaker forums) showing a short calculation
using the Ceiling function - a variation of the Round function (it always rounds up).
The results synced perfectly with Maryland's chart.

After rewriting the function, I thought "why not make it flexible so it could be used in
other states." I downloaded charts from a dozen other states, added a few extra
parameters, and started testing. The results were accurate for every state I tested.
You just need test it to see which computational method is used by your state. That's
why I created this testing demo. I can't guarantee every state will use one of these
computational methods but if it works for you, enjoy.

A demo file and state charts are available at this link:

Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


There are no comments yet. Be the first to post a comment about this Custom Function! Please try to keep it brief & to the point. Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 7 + 1 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. ExcludeValues(MyList ; Out)
  (Wed, Mar 21, 7:23am)
2. PreviousMonthEndDate ( myDate )
  (Wed, Mar 07, 3:35am)
3. PreviousMonthName (myDate)
  (Wed, Mar 07, 3:33am)
4. FmTableFields ( tableName ; fieldsInclude ; fieldsExclude ; classExclude ; typeExclude ; prefixExclude )
  (Fri, Mar 02, 6:32am)
5. sql.getTable ( fullyQualifiedFieldObject )
  (Thu, Feb 22, 8:36am)
6. sql.getField ( fullyQualifiedFieldObject )
  (Thu, Feb 22, 8:34am)
7. FilterOut ( ListA ; ListB )
  (Wed, Feb 21, 6:11pm)
8. Char0 ( )
  (Sun, Feb 18, 2:35am)

RSS Feed of Custom Functions