Formula Errors

How to Use an Excel Formula to Return Values When Date and Text Match in WPS Spreadsheets

Muhammad TalhaMuhammad Talha Nov 13, 2026 869 views

Question details

The user needs an Excel-compatible formula that checks whether a date is in January and a text cell equals "loon", then returns the matching number from another column or leaves the row blank, with a SUMPRODUCT alternative for the total.

How to Use an Excel Formula to Return Values When Date and Text Match in WPS Spreadsheets
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
The user is working with a data range containing dates, descriptions, and numbers and wants to extract or total values when both a January date and the text "loon" match on the same row.
Observed behavior
The goal state is for matching rows to show the value from column C in column D and for nonmatching rows to remain blank; a single-cell SUMPRODUCT total should also calculate the sum of all matching values.
Before you start

Make sure your worksheet has dates in column A, text descriptions in column B, and numeric values in column C. Confirm that the date cells are formatted as actual dates rather than text so MONTH(A2) can read them correctly.

Solution 1Recommended

Return Matching Values Row by Row with IF, AND, and MONTH

Use this formula in D2 and copy it down when you need a visible value for each matching row and a blank for nonmatching rows.

The formula combines MONTH(A2)=1 to identify January dates, B2="loon" to check the exact text, and IF to return the value from C2 only when both conditions are true. If either condition is false, the formula returns an empty string so the row remains blank.

1
Select cell D2

Click cell D2 in your WPS Spreadsheets worksheet, where the first result should appear.

2
Enter the row formula

Type =IF(AND(MONTH(A2)=1,B2="loon"),C2,"") and press Enter. WPS Spreadsheets accepts this Excel-compatible formula directly.

3
Copy the formula down

Drag the fill handle from D2 down through the remaining data rows to apply the same date and text check to each row.

Return Matching Values Row by Row with IF, AND, and MONTH
Formula ready: Matching January loon rows now display the value from column C, and all other rows remain blank.

Use WPS Spreadsheets to Return Values When a Date and Text Match

You can complete this task directly in WPS Spreadsheets using the same Excel-compatible IF, AND, MONTH, and SUMPRODUCT formulas. It keeps row formulas readable while giving you a single-cell total, without needing Microsoft Excel.

  1. 1. Open your workbook in WPS Spreadsheets: Launch WPS Office, open the workbook that contains the date, text, and value columns, and click the worksheet tab where you want the results.
  2. 2. Enter the row formula: Click the first result cell, type =IF(AND(MONTH(A2)=1,B2="loon"),C2,""), and press Enter.
  3. 3. Fill the formula down: Drag the fill handle from the first result cell down through all data rows to apply the check to each row.
  4. 4. Add the total formula: Click an empty cell and type =SUMPRODUCT((MONTH(A2:A60)=1)*(B2:B60="loon")*C2:C60), then press Enter to get the matching total.
Returns only matching January loon rows and leaves other rows blankUses familiar Excel-compatible formulas in WPS SpreadsheetsSupports .xlsx, .xls, and .csv files for seamless Microsoft Excel compatibilityFree and lightweight with a familiar ribbon interface
microsoft office alternative - wps office

Frequently Asked Questions

What does MONTH(A2)=1 do in the formula?

It converts the date in A2 to its month number and checks whether it equals 1, meaning January. If A2 contains text instead of a real date, the formula may return an error, so confirm the cell is formatted as Date.

How can I match a different text instead of "loon"?

Replace B2="loon" with your own exact-text condition, such as B2="invoice". Keep the text inside double quotes. For partial matching, use SEARCH or ISNUMBER instead of direct equality.

Why are nonmatching rows blank?

The IF function returns an empty string "" when the AND condition is false. If you prefer a zero or another value to appear, replace "" in the formula with 0 or your custom text.

Can I total all matching values without creating a helper column?

Yes. Use =SUMPRODUCT((MONTH(A2:A60)=1)*(B2:B60="loon")*C2:C60) in one cell to sum only the rows where the January date and exact text both match.

Does this work the same in WPS Spreadsheets and Microsoft Excel?

Yes, these formulas use MONTH, AND, IF, and SUMPRODUCT and are compatible across WPS Spreadsheets and Excel. The results are the same when the date and text data are consistent.