If any cell in in a range is blank then don't perform the sum

Jak

Well-known Member
Joined
Apr 5, 2002
Messages
833
Hi Guys

I need help with a formula =ROUND(SUM(A12:A14/3),0)

In the image below, Example 1, the value in B14 is derived from the formula above. This formula has been filled down in column B and the rounded, summed and divided values are shown in Examples 2 - 4.

1669552594558.png


What I would like to do is return "0" in column B where there are blank cells in column A.

In Example 2 above, A15 has no value. So rather than rounding and summing the values in A13:A15 and dividing by 3, I would like B15 to show "0". When a value is added into A15, then it will calculate and return the value in B15.

So unless there are 3 values to use in the calculation, cell B should be "0". Hope this makes sense.

Any help with the formula is appreciated.
 

Attachments

  • 1669551881523.png
    1669551881523.png
    33.7 KB · Views: 2

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
@Jak
For me, your logic would impact upon the result for rows 3 & 4 ????
Here perhaps is one possibility.
Book9
AB
1
2PointsAverage
3340
4100
51620
6711
73118
8815
92321
102017
11817
121113
132013
140
150
160
Sheet2
Cell Formulas
RangeFormula
B3:B16B3=IF(SUM(1*ISNUMBER(A1:A3))<3,0,ROUND(SUM(A1:A3/3),0))
 
Upvote 0
Solution
Please use XL2BB (Link in my signature), and update your profile to indicate what version of Excel you're using.

Not sure why you're always dividing by 3 instead of just using average:
Book1
AB
1Example
2PointsAverage
3340
4100
51620
6711
73118
8815
92321
102017
11817
121113
132013
142017
150
160
170
Sheet1
Cell Formulas
RangeFormula
B3:B17B3=IF(AND(ISNUMBER(A1),ISNUMBER(A2),ISNUMBER(A3)),ROUND(AVERAGE(A1:A3),0),0)

Bonus tip. The header "Example" is centered across columns A and B using the Horizontal Alignment "Center across selection". Merge and Center $ucks and really screws up the structure of data. I know of only one instance I've used it, and that was because I needed to, and it was in a Dashboard.

Snakehips solution is the same idea but more succinct, while mine may be clearer and avoids the extra step of dividing. Take your pick!
 
Upvote 0
Hi Snakehips and jdellasala

Thank you for the formulas and insights that will help with future postings. I have tried them both methods out and each resolves my problem.
 
Upvote 0

Forum statistics

Threads
1,214,896
Messages
6,122,132
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top