Function Problems

How to Use an Excel Formula to Assign 1 or -1 for a Timeline in WPS Office

Olivia MillerOlivia Miller Nov 13, 2026 869 views

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.

How to Use an Excel Formula to Assign 1 or -1 for a Timeline in WPS Office
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.
Before you start

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.

Solution 1Recommended

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.

1
Select cell D2

Open WPS Office Spreadsheets and click cell D2, where the timeline result will appear.

2
Enter the formula

Type =IF(A2="","",IF(ISEVEN(C2),1,-1)) into D2 and press Enter.

3
Fill the formula down

Select D2, then drag the fill handle down over the remaining timeline rows to apply the formula.

Use IF and ISEVEN to Return Blank, 1, or -1
Expected result: D2 stays blank when A2 is empty; otherwise it shows 1 for an even C2 and -1 for an odd C2.
WPS Spreadsheets Formula Help

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. 1. Open the timeline workbook: Launch WPS Office Spreadsheets and open the .xlsx or .xls file containing the timeline data.
  2. 2. Go to cell D2: Click D2 in the worksheet where the result should appear.
  3. 3. Type the formula: Enter =IF(A2="","",IF(ISEVEN(C2),1,-1)) and press Enter.
  4. 4. Fill down the column: Drag the fill handle from D2 through the remaining timeline rows to apply the formula.
Returns blank for empty A2 and 1 or -1 based on even/odd C2 valuesWorks with .xlsx, .xls, and other Microsoft Excel-compatible formatsFamiliar ribbon and formula bar make it easy to adapt existing Excel filesFree Office suite that opens and edits timeline workbooks without extra setup
microsoft office alternative - wps office

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.