Method 1 – Combine IF and AND Functions to Calculate If Cells are Not Blank
Step 1:
- Add a row to show the calculation.
Step 2:
- Go to Cell C14.
- Write the formula, and that is:
=IF(AND(B7<>"",B8<>""),C7+C8,"")
Step 3:
- Press Enter.
Get a SUM calculation as the comparing cells contain data.
Step 4:
- Delete the data of Cell B7 and see what happens.
Any blank cell is found, no calculation will be done.
Method 2 – Apply IF and OR Functions to Calculate for Non-blank Cells
Step 1:
- Go to Cell C14.
- Write the combination of the IF & OR formula. The formula will:
=IF(OR(B7="",B8=""),"",C7+C8)
Step 2:
- Press Enter.
As our comparing cells contain data, we get a sum result after calculation.
Step 3:
- We want to see what happens with blank cells.
- Delete data from Cell B7.
We see that blank is showing, no calculation is done because of blank cells.
Method 3 – Combine ISBLANK and OR Functions to Calculate for Non-empty Cells
Step 1:
- Write the formula in Cell C14. The formula will be:
=IF(OR(ISBLANK(B7),ISBLANK(B8)),"",C7+C8)
Step 2:
- Press Enter.
As our reference cells contain data, we get a result after calculation.
Step 3:
- Delete data from any of the reference cells to see what happens.
We get blank in the return, as one cell is blank.
Method 4 – Join COUNTA and IF to Sum Non-empty Cells Only
Step 1:
- Go to Cell C14 and write the following formula.
=IF(COUNTA(B5:B12)=8,SUM(C5:C12),"")
Step 2:
- Press Enter.
All the data of the Name column. The COUNTA function counts the number of cells with data and compares it with the total cell number of that range. As the comparison doesn’t match with the range number no calculation is performed.
Step 3:
- Add random data on Cell B9.
We can see a return now; no cell is blank now.
Method 5 – Join IF and COUNTBLANK to Sum Non-blanks with Blank Cells Inside
Step 1:
- Write the COUNTBLANK function in Cell C14. The formula will be:
=IF(COUNTBLANK(B5:B12),"",SUM(C5:C12))
Step 2:
- Press Enter.
As the formula found blank cells in the selected range, no result shows.
Step 3:
- Put random data in Cell B9 and see what happens.
No blank cells are present in the range and show the sum result.
Method 6 – COUNTIF Operation to Compute Total for Non-blank Cells
Step 1:
- Go to Cell C14.
- Write the following formula:
=IF(COUNTIF(B5:B12,"")>0,"",SUM(C5:C12))
Step 2:
- Press Enter.
We can see no result after applying the formula.
Step 3:
- Add random data in Cell B9.
We get results as we don’t have any blanks in our selected range.
Method 7 – Join SUMPRODUCT and IF to Sum the Data with Blank Cells Inside
Step 1:
- Apply the SUMPRODUCT function with the following formula:
=IF(SUMPRODUCT(--(B5:B12=""))>0,"",SUM(C5:C12))
Step 2:
- Press Enter.
Step 3:
- Put a name in the blank cell of the Name column.
We can see the desired result is showing because all the cells are filled with data.
Download Practice Workbook
Download this practice workbook to exercise while you are reading this article.
Related Articles
- How to Find & Count If a Cell Is Not Blank
- How to Apply Conditional Formatting in Excel If Another Cell Is Blank
- If a Cell Is Blank then Copy Another Cell in Excel
- If Cell is Blank Then Show 0 in Excel
- How to Check If Cell Is Empty in Excel
- How to Check If Cell Is Empty Using Excel VBA
- Excel VBA: Check If Multiple Cells Are Empty
<< Go Back to Excel Cells | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!