Calculation Issues

How to Use Excel Formulas in WPS Spreadsheets to Show Current Purchases and Previous Prices

Anum MushtaqAnum Mushtaq Nov 13, 2026 869 views

Question details

The user needs a dynamic WPS Spreadsheets formula that filters stock codes purchased during a selected date period, then shows the latest purchase date, quantity, current price, most recent previous price, and the percentage difference between current and previous price.

How to Use Excel Formulas in WPS Spreadsheets to Show Current Purchases and Previous Prices
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
The user is building a purchase report from a table containing stock codes, purchase dates, quantities, and prices, and wants to compare current purchasing activity with previous prices for each stock code.
Observed behavior
The intended report should dynamically list each eligible stock code and calculate the current purchase details, previous price, and percentage change without manual filtering.
Before you start

Arrange the purchase table with clear columns for stock code, purchase date, quantity, and price, and ensure the date column contains real date values rather than text. Confirm that your WPS Spreadsheets version supports dynamic array functions such as FILTER, SORT, LET, and REDUCE before using the recommended formula.

Solution 1Recommended

Build a Dynamic Report with LET, FILTER, SORT, and REDUCE

Use this method when you want WPS Spreadsheets to automatically refresh the entire stock code report whenever the selected start or end date changes.

This approach mirrors Excel 365 dynamic array patterns. It filters the purchase table by the selected period, identifies each unique stock code, finds the latest purchase row, then searches earlier purchases for the most recent previous price.

1
Set up the date criteria cells

Enter the selected start date in cell G1 and the selected end date in cell G2, then apply a Date format from the Home tab.

2
Filter current-period purchase rows

Click an empty cell and enter =FILTER(A2:D1000,(B2:B1000>=G1)*(B2:B1000<=G2),"No purchases") to isolate the rows purchased within the selected period.

3
Create the dynamic report formula

In cell E1, enter a LET/REDUCE formula that uses UNIQUE on the stock-code column, SORT to order purchases by date descending, FILTER to find earlier purchases before each latest purchase, and VSTACK/HSTACK to output the report.

4
Add the percentage difference calculation

In the Percentage Difference column, use =(CurrentPrice-PreviousPrice)/PreviousPrice and format the result as a percentage from the Home tab.

Build a Dynamic Report with LET, FILTER, SORT, and REDUCE
Dynamic result: Changing the start or end date recalculates the formula and updates the current purchase and previous price report automatically.
Direct solution in WPS Spreadsheets

Create a Current Purchase vs Previous Price Report in WPS Spreadsheets

WPS Spreadsheets supports Excel-compatible dynamic formulas such as FILTER, SORT, LET, and REDUCE, so you can build a self-updating purchase report without switching to Microsoft Excel and without expensive add-ins.

  1. 1. Open WPS Office Spreadsheets: Launch WPS Office, open the workbook that contains the purchase data, and click the worksheet with the stock code, date, quantity, and price table.
  2. 2. Enter the date filter cells: Type the selected start date and end date into two empty cells such as G1 and G2, and format them as dates using the Home tab.
  3. 3. Insert the FILTER formula: Click an empty cell, type =FILTER(A2:D1000,(B2:B1000>=G1)*(B2:B1000<=G2),"No purchases"), and press Enter to isolate the selected period rows.
  4. 4. Build the dynamic report formula: Enter the LET/REDUCE formula in a report cell to calculate each stock code's latest purchase date, quantity, current price, previous price, and percentage difference.
  5. 5. Format and save as Excel: Set the Percentage Difference column to Percentage format, then click Menu > Save As and choose .xlsx to keep Excel compatibility.
Automatically filter stock codes by the selected period and calculate current vs previous priceCompatible with Excel .xlsx formulas, including LET, FILTER, SORT, and REDUCEFree WPS Office spreadsheet app with a familiar Excel-like ribbonSave, open, and share Microsoft Excel workbooks without conversionLightweight and easy-to-use for purchase reports and analysis
microsoft office alternative - wps office

Frequently Asked Questions

Does WPS Office support Excel dynamic array functions like FILTER and LET?

Yes, recent WPS Spreadsheets versions support many Excel dynamic array functions, including FILTER, SORT, UNIQUE, LET, and REDUCE. If a function is not recognized, update WPS Office or use the helper-column method instead.

What should I do if the formula returns #SPILL! or #CALC!?

Make sure the output area below and to the right of the formula cell is empty so the dynamic array can spill. If no previous price exists for a stock code, wrap the previous-price lookup in IFERROR or an empty-string check to avoid #CALC! errors.

Why is my date filter returning no purchases?

Check that the purchase date column is formatted as real dates and that the start and end date cells are also dates. If dates are stored as text, use Data > Text to Columns or apply a date format to fix them.

Can I save this WPS Spreadsheets report as a Microsoft Excel file?

Yes. Click Menu > Save As, choose the .xlsx format, and the workbook will keep Excel-compatible formulas for anyone opening it in Microsoft Excel.

How do I calculate the percentage difference between current price and previous price?

Use =(CurrentPrice-PreviousPrice)/PreviousPrice. Then select the result cells and click Percent Style on the Home tab to display the difference as a percentage.