How to Use an Excel Formula to Assign 1 or -1 for a Timeline in WPS Office
Question details
The user needs a WPS Spreadsheets formula that returns a blank when A2 is empty, 1 when C2 is even, and -1 when C2 is odd for timeline calculations.

- Product
- WPS Office Spreadsheets
- Device & OS
- not provided
- Scenario
- The user is creating or updating a timeline and wants to automatically classify row values in column D based on blank cells in column A and even/odd numbers in column C.
- Observed behavior
- D2 should return blank when A2 is blank, 1 when C2 is even, and -1 when C2 is odd.
Open the timeline workbook in WPS Office Spreadsheets and confirm the input cell references match the formula: column A is the blank check, column C is the numeric value, and the formula will be entered in D2.
Use IF and ISEVEN to Return Blank, 1, or -1
Use this solution when you want the simplest formula that checks A2, evaluates whether C2 is even or odd, and fills the result down the timeline.
The formula first checks whether A2 is empty, so rows with no entry remain blank. If A2 has a value, the ISEVEN function evaluates C2 and returns TRUE for even numbers or FALSE for odd numbers; the IF function then outputs 1 or -1.
Open WPS Office Spreadsheets and click cell D2, where the timeline result will appear.
Type =IF(A2="","",IF(ISEVEN(C2),1,-1)) into D2 and press Enter.
Select D2, then drag the fill handle down over the remaining timeline rows to apply the formula.

Alternative Formula Using MOD for Even and Odd Checks
Use this alternative if you prefer a more explicit even/odd test that is also compatible with older spreadsheet versions.
Apply the Formula in WPS Office Spreadsheets Without Compatibility Issues
WPS Office Spreadsheets can directly handle this Excel-style formula. Open your timeline file, enter the formula in D2, and use the fill handle to apply it down, with full support for IF and ISEVEN and no need to switch to another Office suite.
- 1. Open the timeline workbook: Launch WPS Office Spreadsheets and open the .xlsx or .xls file containing the timeline data.
- 2. Go to cell D2: Click D2 in the worksheet where the result should appear.
- 3. Type the formula: Enter =IF(A2="","",IF(ISEVEN(C2),1,-1)) and press Enter.
- 4. Fill down the column: Drag the fill handle from D2 through the remaining timeline rows to apply the formula.

Frequently Asked Questions
What does =IF(A2="","",IF(ISEVEN(C2),1,-1)) do?
It checks A2 first: if A2 is blank, D2 returns blank. If A2 is not blank, it checks whether C2 is even. ISEVEN(C2) returns TRUE for even numbers, so the formula returns 1; for odd numbers it returns -1.
Can I use this formula when C2 contains text or is blank?
ISEVEN expects a numeric value. If C2 contains text, the formula may return a #VALUE! error. You can wrap it with IFERROR, for example: =IF(A2="","",IFERROR(IF(ISEVEN(C2),1,-1),"")).
Does WPS Office Spreadsheets support the ISEVEN function?
Yes. WPS Office Spreadsheets supports ISEVEN and IF, and the formula is compatible with Excel workbooks saved in .xlsx format.
How do I apply the formula to the whole timeline at once?
Select D2, move the cursor to the bottom-right corner of the cell until the fill handle appears, then double-click or drag it down. This copies the formula and adjusts the row references automatically.




