Calculation Issues

How to Calculate Fuel Costs Across Multiple Price Thresholds in Excel

Algirdas JasaitisAlgirdas Jasaitis Oct 16, 2026 870 views

Question details

Calculate fuel charges when cumulative fuel usage crosses one or more volume thresholds with varying price tiers.

How to Calculate Fuel Costs Across Multiple Price Thresholds in Excel
Product
Excel
Device & OS
not provided
Scenario
Tracking fuel consumption per individual and applying different price rates automatically based on total accumulated usage.
Observed behavior
The formula needs to dynamically allocate gallons across different pricing tiers when a transaction bridges two thresholds, maintaining an accurate running cost.
Before you start

Ensure your fuel usage data is organized in columns by individual and date, and that you have a separate reference sheet containing your volume thresholds and corresponding price tiers.

Solution 1Recommended

Use Nested IF and SUMIF Formulas for Basic Tiers

This method works best for straightforward scenarios involving two or three fixed price thresholds based on individual cumulative usage.

By utilizing the SUMIF function, you can determine an individual's total rolling gallons. Nested IF statements then compare this total against your pricing limits to calculate the cost.

Note: The formula splits the calculation into portions if the user's usage bridges the gap between the first and second pricing tiers.

1
Set up the pricing reference table

In a separate sheet (e.g., named 'List'), enter your volume thresholds in column S (e.g., S3, S4) and your corresponding tier prices in column T (e.g., T3, T4).

2
Enter the nested formula

In your main tracking sheet, assume Column B contains the individual's name and Column C contains the gallons used in the current transaction. In the cost column, enter the following formula: =IF(SUMIF(B:B,B2,C:C)<=List!$S$3,C2*List!$T$3,IF(SUMIF(B:B,B2,C:C)<=List!$S$4,((C2-List!$S$3)*List!$T$4)+(List!$S$3*List!$T$3),(((C2-SUMIF(B:B,B2,C:C))*List!$T$4)+(SUMIF(B:B,B2,C:C)*List!$T$3))))

3
Calculate remaining gallons (Optional)

If you need to display the gallons remaining before hitting the next tier for a specific individual, use the formula: =List!$S$3-SUMIF(B:B,B2,C:C)

4
Apply across all data

Drag the fill handle down to apply these formulas to all rows in your dataset. The references to the 'List' sheet are locked with absolute references ($) so they won't shift.

Use Nested IF and SUMIF Formulas for Basic Tiers
Formula Adaptation: Ensure you adjust the column letters in the formula (like B:B and C:C) to match where your names and gallon amounts are actually located.
Calculate Tiered Data with Ease

Handle Complex Tiered Pricing with WPS Spreadsheet

WPS Spreadsheet fully supports advanced mathematical functions, logical formulas, and array calculations like SUMIF, INDEX, and MATCH, allowing you to seamlessly process complex tiered pricing models without software constraints.

  1. 1. Open your data file: Launch WPS Spreadsheet and open the workbook containing your fuel usage logs and pricing tiers.
  2. 2. Access the function library: Navigate to the 'Formulas' tab on the top ribbon to easily insert complex logical and lookup functions.
  3. 3. Input nested calculations: Use the formula bar to paste or construct your SUMIF and INDEX/MATCH statements to allocate costs accurately.
  4. 4. Save and share: Save your document in standard .xlsx format to ensure your tiered calculations remain fully functional for collaborators using Microsoft Excel.
100% compatible with Microsoft Excel formulas, formatting, and file types (.xlsx).Handles heavy calculations involving nested IFs and complex arrays smoothly.Built-in function wizard helps structure long formulas and prevent syntax errors.Lightweight, powerful, and completely free alternative for everyday data tasks.
microsoft office alternative - wps office

Frequently Asked Questions

How do I calculate a running total by specific individuals instead of the entire column?

To calculate a cumulative running total per individual, use the SUMIFS function with an expanding range. For example, =SUMIFS(C$2:C2, B$2:B2, B2). The locked starting row ($2) combined with the unlocked ending row (2) ensures the sum expands row-by-row, but only for the specific individual matched in column B.

Can I use VLOOKUP instead of nested IF statements for tiered pricing?

Yes, VLOOKUP is often cleaner than nested IFs for tiered calculations. By setting the 'range_lookup' argument to TRUE (or 1), VLOOKUP will find the closest match that is less than or equal to your search value, which is perfect for identifying which pricing threshold a cumulative volume falls into.

Why is my INDEX MATCH formula returning an #N/A error?

This usually happens if the search value cannot be found, or if the arrays in your MATCH function are mismatched in size. If you are using multiple criteria separated by multiplication (e.g., matching a date between a start and end date), verify that you are entering the formula as an array formula (using Ctrl+Shift+Enter) depending on your spreadsheet version.