ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   testing cells in a row (https://www.excelbanter.com/excel-programming/431918-testing-cells-row.html)

thomas donino

testing cells in a row
 
I am trying to check whether there are any values in, for example row 10
cells A-M and IF there are any values in ANY of those cells then I will total
A10:M10 in cell N10. I am having trouble with the IF code for cell N10 to
check the other cells for values

JLGWhiz[_2_]

testing cells in a row
 
If Application.Sum(Range("A10:M10")) "" Then
N10 = Application.Sum(Range("A10:M10"))
End If


"thomas donino" wrote in message
...
I am trying to check whether there are any values in, for example row 10
cells A-M and IF there are any values in ANY of those cells then I will
total
A10:M10 in cell N10. I am having trouble with the IF code for cell N10 to
check the other cells for values




thomas donino

testing cells in a row
 
That is for VB I assume, can I put a formula in cell N10 that works the same
way?

"JLGWhiz" wrote:

If Application.Sum(Range("A10:M10")) "" Then
N10 = Application.Sum(Range("A10:M10"))
End If


"thomas donino" wrote in message
...
I am trying to check whether there are any values in, for example row 10
cells A-M and IF there are any values in ANY of those cells then I will
total
A10:M10 in cell N10. I am having trouble with the IF code for cell N10 to
check the other cells for values





John

testing cells in a row
 
see if this does what you want. Place in N10

=IF(SUM(A10:M10),SUM(A10:M10),0)
--
jb


"thomas donino" wrote:

That is for VB I assume, can I put a formula in cell N10 that works the same
way?

"JLGWhiz" wrote:

If Application.Sum(Range("A10:M10")) "" Then
N10 = Application.Sum(Range("A10:M10"))
End If


"thomas donino" wrote in message
...
I am trying to check whether there are any values in, for example row 10
cells A-M and IF there are any values in ANY of those cells then I will
total
A10:M10 in cell N10. I am having trouble with the IF code for cell N10 to
check the other cells for values





Dana DeLouis

testing cells in a row
 
That is for VB I assume..

Hi. This is in excel.programming. :)

As a worksheet formula, perhaps:

=IF(COUNT(A10:M10)0,SUM(A10:M10),#N/A)

(#N/A to your choice of course)
= = = = = = =
HTH :)
Dana DeLouis

thomas donino wrote:
That is for VB I assume, can I put a formula in cell N10 that works the same
way?

"JLGWhiz" wrote:

If Application.Sum(Range("A10:M10")) "" Then
N10 = Application.Sum(Range("A10:M10"))
End If


"thomas donino" wrote in message
...
I am trying to check whether there are any values in, for example row 10
cells A-M and IF there are any values in ANY of those cells then I will
total
A10:M10 in cell N10. I am having trouble with the IF code for cell N10 to
check the other cells for values




Gary Keramidas

testing cells in a row
 
i was going to throw one out there too, but i can't really see the logic here.
if there are no numbers, you're not going to have a sum anyway.

so, = sum(a10:m10) will = 0 if here is only text or zeroes, and a value if a
number is contained in the range.

or, am i missing something?



--

Gary Keramidas
Excel 2003


"Dana DeLouis" wrote in message
...
That is for VB I assume..


Hi. This is in excel.programming. :)

As a worksheet formula, perhaps:

=IF(COUNT(A10:M10)0,SUM(A10:M10),#N/A)

(#N/A to your choice of course)
= = = = = = =
HTH :)
Dana DeLouis

thomas donino wrote:
That is for VB I assume, can I put a formula in cell N10 that works the same
way?

"JLGWhiz" wrote:

If Application.Sum(Range("A10:M10")) "" Then
N10 = Application.Sum(Range("A10:M10"))
End If


"thomas donino" wrote in message
...
I am trying to check whether there are any values in, for example row 10
cells A-M and IF there are any values in ANY of those cells then I will
total
A10:M10 in cell N10. I am having trouble with the IF code for cell N10 to
check the other cells for values




Dana DeLouis[_3_]

testing cells in a row
 
= sum(a10:m10) will = 0 if here is only text or zeroes,

Hi. The sum could be zero from, say, only two values of +5, and -5.
The op will have to decide want he wants to do.

:)
Dana DeLouis




Gary Keramidas wrote:
i was going to throw one out there too, but i can't really see the logic
here. if there are no numbers, you're not going to have a sum anyway.

so, = sum(a10:m10) will = 0 if here is only text or zeroes, and a value
if a number is contained in the range.

or, am i missing something?




thomas donino

testing cells in a row
 
Thanks to all respondents, I am using

=IF(SUM(A10:M10) < 0,SUM(A10:M10),0)

and its working just fine

"Dana DeLouis" wrote:

= sum(a10:m10) will = 0 if here is only text or zeroes,

Hi. The sum could be zero from, say, only two values of +5, and -5.
The op will have to decide want he wants to do.

:)
Dana DeLouis




Gary Keramidas wrote:
i was going to throw one out there too, but i can't really see the logic
here. if there are no numbers, you're not going to have a sum anyway.

so, = sum(a10:m10) will = 0 if here is only text or zeroes, and a value
if a number is contained in the range.

or, am i missing something?





thomas donino

testing cells in a row
 
How would i test to see if EVERY cell in that range was blank?

"Dana DeLouis" wrote:

= sum(a10:m10) will = 0 if here is only text or zeroes,

Hi. The sum could be zero from, say, only two values of +5, and -5.
The op will have to decide want he wants to do.

:)
Dana DeLouis




Gary Keramidas wrote:
i was going to throw one out there too, but i can't really see the logic
here. if there are no numbers, you're not going to have a sum anyway.

so, = sum(a10:m10) will = 0 if here is only text or zeroes, and a value
if a number is contained in the range.

or, am i missing something?





Gary Keramidas

testing cells in a row
 
try this

=IF(COUNTBLANK(A10:M10)=13,"all blank","not all blank")

--

Gary Keramidas
Excel 2003


"thomas donino" wrote in message
...
How would i test to see if EVERY cell in that range was blank?

"Dana DeLouis" wrote:

= sum(a10:m10) will = 0 if here is only text or zeroes,

Hi. The sum could be zero from, say, only two values of +5, and -5.
The op will have to decide want he wants to do.

:)
Dana DeLouis




Gary Keramidas wrote:
i was going to throw one out there too, but i can't really see the logic
here. if there are no numbers, you're not going to have a sum anyway.

so, = sum(a10:m10) will = 0 if here is only text or zeroes, and a value
if a number is contained in the range.

or, am i missing something?







All times are GMT +1. The time now is 09:58 AM.

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