How to Use an IF Formula to Assign Values to Multiple Cells in WPS Office Excel
Question details
The user needs to know whether one Excel IF formula can set values in two separate cells when a condition is true, and how to achieve that result.

- Product
- WPS Office Spreadsheets
- Device & OS
- not provided
- Scenario
- Building a spreadsheet condition that should update two destination cells from one logical test, such as changing B1 and C1 when A1 equals Yes.
- Observed behavior
- A standard worksheet formula cannot write to multiple cells by itself; each destination cell must contain its own formula, or a macro must be used.
Open your workbook in WPS Office Spreadsheets and identify the condition cell, such as A1, and the two destination cells, such as B1 and C1, that should respond to the condition.
Use a Separate IF Formula in Each Destination Cell
This is the standard and fastest way to update multiple cells because each cell evaluates the same condition independently.
Worksheet formulas return a value only to the cell where they are entered. To update B1 and C1 from A1, place an IF formula in both B1 and C1 instead of expecting one formula to control multiple cells.
Click cell B1 in your WPS Office Spreadsheets workbook, or select the first cell that should show a result.
Type =IF(A1="Yes",1,"") and press Enter. This displays 1 when A1 equals Yes and leaves the cell blank otherwise.
Click cell C1, or select the second cell that should show a different result.
Type =IF(A1="Yes",2,"") and press Enter. This displays 2 when A1 equals Yes and leaves the cell blank otherwise.

Use a VBA Macro When One Action Must Write to Multiple Cells
Use this when you want a single action, such as clicking a button or running a macro, to write values to several cells at once.
Apply IF Logic to Multiple Cells in WPS Office Spreadsheets
WPS Office Spreadsheets uses the same IF function syntax as Excel. Enter a separate IF formula in each target cell to update multiple cells from one condition while keeping full .xlsx compatibility.
- 1. Open your workbook in WPS Office Spreadsheets: Launch WPS Office, click Open, and select the Excel workbook that contains your condition cell.
- 2. Enter the first IF formula: Select the first result cell, type =IF(A1="Yes",1,""), and press Enter.
- 3. Enter the second IF formula: Select the second result cell, type =IF(A1="Yes",2,""), and press Enter.
- 4. Test the condition: Change A1 to Yes or another value to verify that both result cells update correctly.

Frequently Asked Questions
Can one Excel formula write data into multiple cells?
No, a standard worksheet formula returns a value only to the cell in which it is entered. To update multiple cells, enter a separate IF formula in each target cell.
How do I make two cells change when A1 says Yes?
In B1 enter =IF(A1="Yes",1,"") and in C1 enter =IF(A1="Yes",2,""). Both formulas use the same A1 condition independently.
Does this work in WPS Office Spreadsheets the same way as Excel?
Yes, WPS Office Spreadsheets supports the same IF function syntax and can open and save Microsoft Excel .xlsx workbooks.
Can I use VBA to write to multiple cells at once?
Yes, a macro can check a condition and assign values to several cells, but it requires a macro-enabled workbook and is not needed for basic worksheet formulas.
What if I want different text or numbers in each cell?
Replace the value_if_true and value_if_false arguments in each cell, for example =IF(A1="Yes","Approved",""). Keep a separate formula in each destination cell.




