summing the numeric values of all cells but equals to zero if any cell contains any text...

amrinderminhas

New Member
Joined
May 24, 2016
Messages
2
Hello to all,
I have a little problem in using summation of the values which in normal case results in adding all values but if any one of the cell contains a text (any text, not specific) then the summation should result to zero.
I have applied this formula for values in cells from A2 to D2

[FONT=Arial, sans-serif]=IF(COUNTIF(A2:D2,"F"),0,IF(COUNTIF(A2:D2,"D"),0,IF(COUNTIF(A2:D2,"I"),0,SUM(A2:D2))))[/FONT]
[FONT=Arial, sans-serif]The above formula works only if particular text is input (such as here for F, D, I), But i have no idea to how to change this formula for any text input or even any cell having anything else than numeric value, then the sum of all cells (containing that particular cell) should result zero

thanx for your cooperation[/FONT]
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Welcome to the forum.

Maybe:

=IF(COUNT(A2:D2)=4,SUM(A2:D2),0)

COUNT returns the number of cells in the range containing numbers. So if it's 4, then all cells in the range are numbers. Empty cells will also return a 0.
 
Upvote 0
Welcome to Mr Excel forum

Maybe this...
=IF(COUNT(A2:D2)=4,SUM(A2:D2),0)

Hope this helps

M.
 
Upvote 0
Yes, Coincidentally u both @Eric and @ Marcelo have given the same solution; now how it can then be incorrect.
This is the perfect solution i am finding, simple and accurate. I have tested it with various combinations and is found to be working for all situations. My heartly thanx to you both
 
Upvote 0

Forum statistics

Threads
1,215,420
Messages
6,124,801
Members
449,189
Latest member
kristinh

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