Function Problems

How to Calculate Expense Totals by Currency with Excel Lookup Rates

Chanuka GeekiyanageChanuka Geekiyanage Nov 10, 2026 870 views

Question details

The user needs to calculate an expense report where amounts must be converted to a base currency (CAD) using lookup rates, while applying tax conditionally based on the selected currency.

How to Calculate Expense Totals by Currency with Excel Lookup Rates
Product
Excel
Device & OS
not provided
Scenario
Managing an expense report with multiple currencies (CAD, USD, EUR) that requires dynamic tax application and exchange rate conversion.
Observed behavior
Amounts are listed in column F and currencies in column G. The goal is to output calculated tax and total converted amounts in CAD using spreadsheet formulas.
Before you start

Ensure you have a separate reference sheet or a structured table containing the up-to-date exchange rates for the currencies you plan to convert.

Solution 1Recommended

Use IF and XLOOKUP for Modern Excel Versions

Combine the IF function for conditional tax calculation and XLOOKUP to fetch exchange rates seamlessly.

The XLOOKUP function is the most robust method for retrieving exchange rates from a reference table. By nesting it alongside an IF statement, you can differentiate between local transactions (which require tax) and foreign transactions (which require conversion).

1
Set up the conditional tax calculation

Select the cell where you want the tax to appear (e.g., H2) and enter the formula =IF(G2="CAD",F2*$K$1,0). This assumes your tax rate is in K1 (locked with dollar signs), the currency is in G2, and the amount is in F2.

2
Calculate the converted total

Select the total cell (e.g., I2) and enter the formula =IF(G2="CAD",F2+H2,F2*XLOOKUP(G2,RateTable[Currency],RateTable[CADRate])). This formula adds the tax if the currency is CAD, or multiplies the amount by the exchange rate fetched via XLOOKUP for USD or EUR.

3
Apply formulas to the entire column

Click the fill handle at the bottom-right corner of cells H2 and I2, then drag it down to the end of your expense data to copy the formulas to all remaining rows.

Use IF and XLOOKUP for Modern Excel Versions
Table Referencing: Using named tables (e.g., RateTable) for your exchange rates prevents errors when adding new currencies in the future.
Efficient Expense Tracking

Calculate Expenses and Conversions easily in WPS Spreadsheet

WPS Spreadsheet fully supports advanced functions like XLOOKUP, VLOOKUP, and nested IF statements, allowing you to build complex expense reports and dynamic currency converters effortlessly.

  1. 1. Open your report in WPS Spreadsheet: Launch WPS Office and open your existing expense report document.
  2. 2. Create an exchange rate table: Navigate to a new sheet or a blank area and input your currency codes and their corresponding exchange rates.
  3. 3. Enter the lookup formulas: Type your =IF() and =XLOOKUP() formulas directly into the formula bar just as you would in Excel.
  4. 4. Save and share: Click 'Save' to keep your document in the standard .xlsx format, ensuring perfect compatibility with colleagues using Microsoft Excel.
100% compatible with Microsoft Excel formulas and .xlsx filesBuilt-in support for modern functions including XLOOKUPLightweight and fast performance for large financial datasetsFree premium-quality templates for expense tracking and budgeting
microsoft office alternative - wps office

Frequently Asked Questions

Why does my XLOOKUP formula return a #NAME? error?

This error typically occurs if you are using an older version of Excel that does not support the XLOOKUP function. If this happens, switch to using VLOOKUP or the INDEX/MATCH combination.

How do I lock the tax rate cell reference in my formula?

Use absolute referencing by adding dollar signs to the cell address (e.g., $K$1). You can quickly add these by clicking on the cell reference in the formula bar and pressing the F4 key on your keyboard.

What if a currency is missing from my exchange rate lookup table?

XLOOKUP has a built-in argument to handle missing data. You can modify your formula to include a fallback value, such as =XLOOKUP(G2,RateTable[Currency],RateTable[CADRate],"Rate Missing"), which will display 'Rate Missing' instead of an #N/A error.

Can I pull live exchange rates into my Excel lookup table?

Yes. In newer versions of Excel, you can use the 'Data Types' feature under the Data tab. Select your currency pairs and click 'Currencies' to fetch live data, which your XLOOKUP formula can then reference dynamically.