Use an IF Formula in WPS Spreadsheets to Calculate Values for A or B
Question details
Calculate a value in C1 by multiplying B1 by a factor determined by whether A1 contains A or B.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- A spreadsheet uses A or B in cell A1 to select the multiplier for the value in B1.
- Observed behavior
- C1 should show the calculated value for A or B and remain blank for other entries.
Enter A or B in A1 and a numeric value in B1. Decide which multiplier to use for each letter; the example below uses 3 for A and 4 for B.
Use a Nested IF Formula to Select the Multiplier
Use this formula when A and B each require a different multiplier and other entries should produce a blank result.
In WPS Spreadsheets, click cell C1.
Type =IF(A1="A",B1*3,IF(A1="B",B1*4,"")) in C1 and press Enter.
Select C1 and edit the formula in the formula bar to replace 3 and 4 with the factors you need.
Enter A in A1 to multiply B1 by 3, or enter B to multiply it by 4. Any other entry returns a blank result.

Calculate Conditional Values with WPS Spreadsheets
Use a nested IF formula in WPS Spreadsheets to apply different multipliers based on a cell's value.
- 1. Open a spreadsheet: Open WPS Spreadsheets and create a workbook or open an existing file.
- 2. Enter the inputs: Type A or B in cell A1 and enter a number in B1.
- 3. Add the formula: Click C1, enter =IF(A1="A",B1*3,IF(A1="B",B1*4,"")), and press Enter.
- 4. Customize the calculation: Select C1 and replace 3 and 4 in the formula bar with your preferred factors.

Frequently Asked Questions
What happens if A1 contains something other than A or B?
The formula returns an empty text string, so C1 appears blank. The formula remains in C1.
How do I change the multipliers?
Click C1 and edit the formula in the formula bar. Replace 3 with the factor for A and 4 with the factor for B.
Can I use the formula for more rows?
Select C1 and drag its fill handle down. The relative references will change for each row, such as A2 and B2 in C2.
Does the formula distinguish between uppercase and lowercase letters?
No. The comparisons in this formula are not case-sensitive, so a and b also match A and B.




