Calculation Issues

Build an Excel Freight Calculator for Import and Export Rates

Adam DavisAdam Davis Nov 20, 2026 869 views

Question details

Create a freight calculator that selects import or export rates by zone and calculates charges using shipment weight and any applicable piece-count rules.

Build an Excel Freight Calculator for Import and Export Rates
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user needs to calculate freight charges from shipment type, zone, weight, and piece count.
Observed behavior
The calculator should use the first-70-kg charge plus an excess-weight charge for shipments above 70 kg.
Before you start

Gather the import and export rate tables, including zone headers, first-70-kg charges, and excess rates per kilogram. Check your tariff for rates below 70 kg and any piece-count charges, as those rules are not specified here.

Solution 1Recommended

Use exact-match lookups to calculate freight for 70 kg and above

Use separate import and export rate tables to select the correct zone and calculate the excess above 70 kg.

This example covers the weight-based charge for shipments of 70 kg or more. Rates below 70 kg and piece-count charges require the applicable tariff rules.

1
Set up the rate tables

On a worksheet, create separate import and export tables with zones in the first row, first-70-kg charges in the second row, and excess rates per kilogram in the third row. Use zone labels such as Zone 1 and Zone 3 consistently.

2
Name each table

Select the complete import table, including its zone headers, and choose Formulas > Define Name. Name it ImportRates. Repeat for the export table and name it ExportRates.

3
Enter shipment details

Enter Import or Export in B2, the zone label in B3, and the shipment weight in kilograms in B4. The zone must match a header in the selected rate table.

4
Calculate the weight charge

Enter this formula in the result cell: =IF(B4<70,"Check under-70 rate",IF(B2="Import",HLOOKUP(B3,ImportRates,2,FALSE)+(B4-70)*HLOOKUP(B3,ImportRates,3,FALSE),IF(B2="Export",HLOOKUP(B3,ExportRates,2,FALSE)+(B4-70)*HLOOKUP(B3,ExportRates,3,FALSE),"Check shipment type"))). FALSE makes each HLOOKUP an exact match.

5
Test the calculation

Enter Export in B2, Zone 3 in B3, and 150 in B4. If the export table lists 1,600.76 for the first 70 kg and 22.68 per excess kilogram, the result should be 3,415.16.

Use exact-match lookups to calculate freight for 70 kg and above
Add tariff-specific rules: The formula does not calculate rates below 70 kg or piece-count charges. Add those rules only after confirming how your freight tariff applies them.
Calculate freight in WPS Spreadsheets

Build the same freight calculator in WPS Spreadsheets

Use named rate tables and exact-match HLOOKUP formulas in WPS Spreadsheets to calculate import and export freight by zone and weight.

  1. 1. Create the rate tables: Open WPS Spreadsheets and create import and export tables with zone headers in row 1, first-70-kg charges in row 2, and excess rates per kilogram in row 3.
  2. 2. Name the tables: Select the complete import table and type ImportRates in the Name Box beside the formula bar. Press Enter, then repeat for the export table using ExportRates.
  3. 3. Enter shipment details: Enter Import or Export in B2, a matching zone label in B3, and the weight in kilograms in B4.
  4. 4. Enter the freight formula: In a result cell, enter =IF(B4<70,"Check under-70 rate",IF(B2="Import",HLOOKUP(B3,ImportRates,2,FALSE)+(B4-70)*HLOOKUP(B3,ImportRates,3,FALSE),IF(B2="Export",HLOOKUP(B3,ExportRates,2,FALSE)+(B4-70)*HLOOKUP(B3,ExportRates,3,FALSE),"Check shipment type"))). Add separate rules for under-70 rates and piece-count charges if your tariff requires them.
Select import or export rates by shipment zoneCalculate excess weight above 70 kgOpen and save Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why should HLOOKUP use FALSE for the zone lookup?

The fourth argument FALSE requires an exact match for the zone header. Without it, HLOOKUP uses an approximate match, which can return the wrong rate.

How much excess weight applies to a 150 kg shipment?

Subtract the 70 kg included in the base charge from 150 kg. The excess is 80 kg, which is multiplied by the applicable excess rate.

How do I calculate freight for a shipment under 70 kg?

Check the relevant import or export tariff for its under-70-kg rates or weight bands. Add those rates to your worksheet and extend the formula to select the applicable charge; the example formula returns a reminder instead.

Does this formula include a charge per piece?

No. The supplied rate rules do not specify how piece count affects the charge. Enter the applicable piece-count rule from your tariff before adding it to the formula.

Why does the formula return a zone lookup error?

Check that the zone in B3 exactly matches a header in the first row of the selected named range. Also verify that ImportRates and ExportRates include their respective header rows.