ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   sum only if there is a value in cells (https://www.excelbanter.com/excel-discussion-misc-queries/237959-sum-only-if-there-value-cells.html)

Geo

sum only if there is a value in cells
 
I have the following formula:
A3=SUM(A1+A2)
Is there a way so that A3 only sums if there is a value in both cells and
not if there is text?
The values are hours and minutes.

Luke M

sum only if there is a value in cells
 
=IF(AND(ISNUMBER(A1),ISNUMBER(A2)),A1+A2,"")

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Geo" wrote:

I have the following formula:
A3=SUM(A1+A2)
Is there a way so that A3 only sums if there is a value in both cells and
not if there is text?
The values are hours and minutes.


T. Valko

sum only if there is a value in cells
 
=IF(AND(ISNUMBER(A1),ISNUMBER(A2)),A1+A2,"")

=IF(COUNT(A1:A2)=2,A1+A2,"")

--
Biff
Microsoft Excel MVP


"Luke M" wrote in message
...
=IF(AND(ISNUMBER(A1),ISNUMBER(A2)),A1+A2,"")

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Geo" wrote:

I have the following formula:
A3=SUM(A1+A2)
Is there a way so that A3 only sums if there is a value in both cells and
not if there is text?
The values are hours and minutes.





All times are GMT +1. The time now is 04:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com