Function Problems

Use an IF Formula in WPS Spreadsheets to Calculate Values for A or B

Huma Ashraf ChHuma Ashraf Ch Nov 18, 2026 868 views

Question details

Calculate a value in C1 by multiplying B1 by a factor determined by whether A1 contains A or B.

Use an IF Formula in WPS Spreadsheets to Calculate Values for 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.
Before you start

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.

Solution 1Recommended

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.

1
Select the result cell

In WPS Spreadsheets, click cell C1.

2
Enter the formula

Type =IF(A1="A",B1*3,IF(A1="B",B1*4,"")) in C1 and press Enter.

3
Adjust the factors

Select C1 and edit the formula in the formula bar to replace 3 and 4 with the factors you need.

4
Check the result

Enter A in A1 to multiply B1 by 3, or enter B to multiply it by 4. Any other entry returns a blank result.

Use a Nested IF Formula to Select the Multiplier
Blank formula result: The formula returns an empty text string when A1 contains neither A nor B; the cell still contains the formula.
Calculate with WPS Spreadsheets

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. 1. Open a spreadsheet: Open WPS Spreadsheets and create a workbook or open an existing file.
  2. 2. Enter the inputs: Type A or B in cell A1 and enter a number in B1.
  3. 3. Add the formula: Click C1, enter =IF(A1="A",B1*3,IF(A1="B",B1*4,"")), and press Enter.
  4. 4. Customize the calculation: Select C1 and replace 3 and 4 in the formula bar with your preferred factors.
Apply different multipliers for A and B with one formulaOpen and edit Microsoft Excel XLSX and XLS filesChange the factors in the formula bar as needed
microsoft office alternative - wps office

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.