Excel Formula for Not Equal To and Blank Cells
Question details
Create a formula that multiplies B1 by C1 only when A1 is Red and B1 is not blank.

- 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.
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.
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.
In Excel, click cell D1.
Type =IF(AND(A1="Red",B1<>""),B1*C1,"") into D1 and press Enter.
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 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. Open your worksheet: Open WPS Spreadsheet and select your workbook, or create a blank spreadsheet.
- 2. Enter the source values: Enter Red in A1 and numbers in B1 and C1.
- 3. Add the formula: Click D1, enter =IF(AND(A1="Red",B1<>""),B1*C1,""), and press Enter.
- 4. Save the workbook: Choose Menu > Save As and select an Excel workbook format such as XLSX.

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.




