Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default 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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default 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?



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default 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?




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default 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?




  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Testing Cells Paul New Users to Excel 6 June 8th 07 07:14 PM
TESTING A RANGE OF CELLS Richard[_2_] Excel Worksheet Functions 3 April 1st 07 02:52 PM
Testing Values of Cells [email protected] Excel Programming 5 July 20th 05 05:36 PM
Testing for contiguous cells jamieuk Excel Programming 2 January 8th 04 05:23 PM
testing for non-empty cells Paul James[_2_] Excel Programming 6 August 3rd 03 09:04 AM


All times are GMT +1. The time now is 07:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"