#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 23
Default help please

I need to create a function that will display an error if the sum of a range
of cells subtracted from another cell does not equal 0. I figure the first
part is
=SUM((J12:M12)-I12) that should total 0 and if it does not I need error to
be shown. Any advice/help greatly appreciated
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Eva Eva is offline
external usenet poster
 
Posts: 197
Default help please

try this
=IF(SUM(J12:M12)-I12<=0,"Error",SUM(J12:M12)-I12)
Eva
"kara" wrote:

I need to create a function that will display an error if the sum of a range
of cells subtracted from another cell does not equal 0. I figure the first
part is
=SUM((J12:M12)-I12) that should total 0 and if it does not I need error to
be shown. Any advice/help greatly appreciated

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 23
Default help please

many thanks eva!

"Eva" wrote:

try this
=IF(SUM(J12:M12)-I12<=0,"Error",SUM(J12:M12)-I12)
Eva
"kara" wrote:

I need to create a function that will display an error if the sum of a range
of cells subtracted from another cell does not equal 0. I figure the first
part is
=SUM((J12:M12)-I12) that should total 0 and if it does not I need error to
be shown. Any advice/help greatly appreciated

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default help please

Doesn't that show "Error" is the answer *does* equal zero?
Did you mean to say
=IF(SUM(J12:M12)-I12<0,"Error",SUM(J12:M12)-I12) ?

That would work OK if the numbers are integers, but if you have decimal
numbers (such as currency with 2 decimal places) you may find that roundings
of the fixed point binary representations may give a small but non-zero
result where you expected zero. If you want to eliminate such cases you may
want something like
=IF(ABS(SUM(J12:M12)-I12)<10^-6,"Error",SUM(J12:M12)-I12)
Adjust the error tolerance to suit.
--
David Biddulph

"Eva" wrote in message
...
try this
=IF(SUM(J12:M12)-I12<=0,"Error",SUM(J12:M12)-I12)
Eva
"kara" wrote:

I need to create a function that will display an error if the sum of a
range
of cells subtracted from another cell does not equal 0. I figure the
first
part is
=SUM((J12:M12)-I12) that should total 0 and if it does not I need error
to
be shown. Any advice/help greatly appreciated



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



All times are GMT +1. The time now is 12:51 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"