Formula Errors

Excel Formula for Not Equal To and Blank Cells

Bushra ParveenBushra Parveen Nov 22, 2026 868 views

Question details

Create a formula that multiplies B1 by C1 only when A1 is Red and B1 is not blank.

Use an Excel Formula for Not Equal To and Blank Cells
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet needs a conditional calculation based on text in A1 and a value in B1.
Observed behavior
The desired result is B1 multiplied by C1 when both conditions are met; otherwise, the formula should display a blank.
Before you start

Check that A1 contains the text to compare and that B1 and C1 contain values suitable for multiplication. Choose an empty result cell, such as D1.

Solution 1Recommended

Use IF and AND to check the text and blank cell

Use this formula to calculate the product only when both conditions are satisfied.

The <> operator means “not equal to.” The test B1<>"" checks that B1 does not evaluate to an empty string.

1
Select the result cell

In Excel, click cell D1.

2
Enter the formula

Type =IF(AND(A1="Red",B1<>""),B1*C1,"") into D1 and press Enter.

3
Check the result

Enter Red in A1 and a number in B1 to test the calculation. Change A1 or clear B1 to confirm that D1 displays a blank.

Use IF and AND to check the text and blank cell
A blank-looking result: The formula returns an empty string when the conditions are not met; D1 still contains a formula and is not truly empty.
Calculate in WPS Spreadsheet

Use the same conditional formula in WPS Spreadsheet

WPS Spreadsheet supports IF and AND formulas, so you can perform the same conditional multiplication in a worksheet.

  1. 1. Open your worksheet: Open WPS Spreadsheet and select your workbook, or create a blank spreadsheet.
  2. 2. Enter the source values: Enter Red in A1 and numbers in B1 and C1.
  3. 3. Add the formula: Click D1, enter =IF(AND(A1="Red",B1<>""),B1*C1,""), and press Enter.
  4. 4. Save the workbook: Choose Menu > Save As and select an Excel workbook format such as XLSX.
Calculate only when the text and nonblank conditions are metOpen and save Microsoft Excel XLSX filesWork with familiar spreadsheet formulas and cell references
microsoft office alternative - wps office

Frequently Asked Questions

What does <> mean in an Excel formula?

The <> operator means “not equal to.” In B1<>"", it checks whether B1 evaluates to something other than an empty string.

Does the formula treat zero as blank?

No. If B1 contains 0, B1<>"" is true, so the formula can return 0 when A1 is Red.

Why does the result look blank even though the cell has a formula?

The final "" in the IF formula returns an empty string when either condition is false. The cell displays no text but still contains the formula.

Can I apply the formula to other rows?

Select D1 and drag its fill handle down. Excel adjusts the relative references for each row, such as A2, B2, and C2.