Spreadsheet Practice

How to calculate shipping cost with an IF formula in Excel

Formula (Excel and Google Sheets)

=IF(B2>=$F$1,0,$F$2)

Return 0 when the order reaches the free-shipping threshold and the fee otherwise: =IF(B2>=$F$1,0,$F$2).

Result on the example
one result per row in C2, filled down to C6
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in C2, filled down to C6. Change any input and the result updates, or edit the formula to experiment.

How it works

When the subtotal reaches the threshold in F1, IF returns 0; otherwise it returns the fee in F2. Order 1003 is exactly 75 and ships free because the test uses >=.

=IF(B2>=$F$1,0,$F$2)

Result0

  1. B2$82.40

    The value in B2.

  2. $F$1$75

    The value in F1.

  3. B2>=$F$1TRUE

    The >= operator tests at least.

  4. $F$2$6.95not used

    The value in F2.

  5. IF(B2>=$F$1,0,$F$2)0

    IF: Returns one value if a test is true, another if false.

    • logical_testB2>=$F$1TRUE
    • value_if_true0
    • value_if_false$F$2$6.95not used

In Google Sheets

The same formula works in Google Sheets: =IF(B2>=$F$1,0,$F$2). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=(B2<$F$1)*$F$2$0.00, $6.95, $0.00…The test is 1 or 0, so it can multiply the fee directly.
=IFS(B2>=$F$1,0,B2>=30,4.95,TRUE,$F$2)$0.00, $4.95, $0.00…Different resultAdds a middle tier with reduced shipping from 30. Order 1002 pays 4.95.

Common mistakes

  • > versus >= decides the order exactly at the threshold. Match your policy's wording: "over" or "from".
  • Decide whether the threshold applies before or after discounts and tax, and calculate on that amount.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Calculate shipping cost with an IF formula

In C2, charge the flat fee in F2 unless the subtotal is at least the amount in F1, in which case shipping is 0. Fill down to C6.

Questions

How do I show the total with shipping?

=B2+IF(B2>=$F$1,0,$F$2).

How do I tell customers how much more to spend?

=IF(B2<$F$1,"Add "&TEXT($F$1-B2,"$0.00")&" for free shipping","").

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.