Function Problems

How to Match Dates Across Excel Sheets and Return Monthly Costs

Adam DavisAdam Davis Oct 26, 2026 868 views

Question details

The user needs to dynamically retrieve monthly project costs from a detailed worksheet and display them on a consolidated overview sheet based on changing project start dates.

How to Match Dates Across Excel Sheets and Return Monthly Costs
Product
Excel
Device & OS
not provided
Scenario
Consolidating monthly project costs from different worksheets where project timelines shift, requiring a formula that searches for a specific month and returns the corresponding cost rather than relying on static column references.
Observed behavior
Using fixed-column IF formulas fails to return the correct monthly cost when a project start date changes, as the formula continues to look at the original static cell instead of dynamically searching for the new date location.
Before you start

Ensure that the dates on both your consolidated overview worksheet and your detailed cost worksheet share the exact same formatting (e.g., both formatted as Date values or identical text strings) so the lookup formula can successfully match them.

Solution 1Recommended

Use XLOOKUP to Match Dates and Return Costs Dynamically

Replace static IF formulas with XLOOKUP to automatically scan across rows for changing dates and return the matching monthly project costs.

XLOOKUP is ideal for this scenario because it dynamically searches a specified array for a value and returns the corresponding item from another array. When project start dates shift horizontally across columns, XLOOKUP will automatically locate the new column without requiring manual formula adjustments.

1
Select the target cell

Open your consolidated overview worksheet and click the cell where you want the monthly cost to be displayed.

2
Enter the XLOOKUP formula

Type the formula =XLOOKUP(B4, Sheet1!B12:Z12, Sheet1!B40:Z40, 0) into the formula bar.

3
Adjust the lookup value

Replace 'B4' with the cell reference on your current sheet that contains the specific month or date you are searching for.

4
Define the lookup and return arrays

Change 'Sheet1!B12:Z12' to the row range containing your project dates on the source sheet, and change 'Sheet1!B40:Z40' to the row range containing the corresponding costs.

5
Apply across columns

Press Enter to return the cost. You can then drag the fill handle across adjacent cells to apply the lookup formula for the remaining months.

Use XLOOKUP to Match Dates and Return Costs Dynamically
Dynamic Updates: Unlike basic IF statements, XLOOKUP dynamically responds to timeline changes. If the project start date shifts to a different column, the formula will automatically find the new location and return the accurate cost.
Advanced Formula Support

Seamlessly Consolidate Project Costs with WPS Spreadsheet

WPS Spreadsheet fully supports advanced lookup functions like XLOOKUP, INDEX, and MATCH natively. Consolidating financial data across multiple sheets is simple, fast, and completely compatible with standard spreadsheet formats.

  1. 1. Install WPS Office: Download and install the free WPS Office suite, then open your project workbook in WPS Spreadsheet.
  2. 2. Navigate to the overview sheet: Select your consolidated overview worksheet and click on the target cell where the monthly cost is needed.
  3. 3. Use the formula helper: Type =XLOOKUP( and utilize WPS Spreadsheet's intuitive formula tooltips to select your lookup date, date array, and cost array.
  4. 4. Instantly retrieve costs: Press Enter to execute the formula and instantly retrieve your dynamically matched project costs across sheets.
100% format compatibility with Microsoft Excel (.xlsx) formulas and functionsNatively supports advanced lookup features like XLOOKUP, VLOOKUP, and HLOOKUPLightweight application ensures fast processing for large financial datasetsFree built-in financial and project management templates for easy setup
microsoft office alternative - wps office

Frequently Asked Questions

Why does my standard IF function fail when the project start date changes?

A standard IF function (e.g., =IF(B4=Sheet1!B12, Sheet1!B40, 0)) checks a fixed cell reference. If your project date shifts from column B to column C, the formula continues to evaluate column B, resulting in an error or a zero. Lookup functions scan the entire range to dynamically find the new location.

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

The #N/A error indicates that the target date cannot be found in the specified lookup range. Ensure that both sheets use the exact same date format (e.g., both are Date objects or both are Text) and check for hidden spaces or mismatched data types.

Can I use VLOOKUP instead to match dates across sheets?

VLOOKUP searches vertically down columns. Because your dates are arranged horizontally across a row with costs in a row below them, you would need HLOOKUP. However, XLOOKUP or INDEX/MATCH are generally preferred as they are more flexible and won't break if you insert new rows between your data.