In Excel, add 1 if not number, or else add the number

In excel, how do I write a formula that does the following:

In a certain cell range, if the cell contains a non-numeric entry, add one, or else add the number the cell contains.

for example

4 xyz def bc 2 0

=9

or

1 ab cd 2 af

=6

Answers


Contents of the data A1:A6

4 xyz x 2 y 0

Write the following formula in cell B1

=SUM(A1:A6)+(COUNTA(A1:A6)-COUNT(A1:A6))

Need Your Help

DB2 Table C UDF DBINFO and SQLUDF_TRAIL_ARGS

c db2

I am currently implementing a C Table UDF and I want to make use of both SQLUDF_CALL_T (it is included in the SQLUDF_TRAIL_ARGS) and the structure dbinfo. Is this possible?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.