Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Geoff C
 
Posts: n/a
Default Help with formula that unexpectedly returns an answer

Hi, hope someone can help. I have a template spreadsheet that contains the
following formula

=IF(AND(ISNUMBER(L23),ISNUMBER(M23),ISNUMBER(L24), ISNUMBER(M24)),(L23+M23+L24+M24)/2,IF(AND(ISNUMBER(L23),ISNUMBER(M23)),L23+M23,"Not calc."))

L23 and L24 are dates, M23 and M24 are times. It's meant to add together the
two sets of date and time fields if they are all present, and calculate their
average. If only the first date and time are present, it should sum them. It
works fine.

However, on a recent occasion a user accidentally deleted row 24 and managed
to change the formula to

=IF(AND(ISNUMBER(L23),ISNUMBER(M23),ISNUMBER(#REF! ),ISNUMBER(#REF!)),(L23+M23+#REF!+#REF!)/2,IF(AND(ISNUMBER(L23),ISNUMBER(M23)),L23+M23,"Not calc."))

Surprisingly (to me) this returned the sum of L23 and M23, and gave the user
an apparently plausible answer that was not noticed for some time. This seems
to be because the formula ISNUMBER(#REF!) does not return an error or #REF!,
just "False".

Please don't suggest protecting the worksheet, because the users have to be
able to delete empty rows. (e.g. if rows 23 and 24 had been both empty, they
would have been deleted).

Can anyone suggest a way to rework the overall formula so that if such
deletion occurs it is obvious that something has gone wrong? Similar
formulae are dotted all over the template, so something simple would be
appreciated!

Many thanks,
Geoff.


  #2   Report Post  
bj
 
Posts: n/a
Default

try
=if(or(iserror(L23),iserror(M23),iserror(L24),iser ror(M24)),"error",IF(AND(ISNUMBER(L23),ISNUMBER(M2 3),ISNUMBER(L24),ISNUMBER(M24)),(L23+M23+L24+M24)/2,IF(AND(ISNUMBER(L23),ISNUMBER(M23)),L23+M23,"Not calc.")))

"Geoff C" wrote:

Hi, hope someone can help. I have a template spreadsheet that contains the
following formula

=IF(AND(ISNUMBER(L23),ISNUMBER(M23),ISNUMBER(L24), ISNUMBER(M24)),(L23+M23+L24+M24)/2,IF(AND(ISNUMBER(L23),ISNUMBER(M23)),L23+M23,"Not calc."))

L23 and L24 are dates, M23 and M24 are times. It's meant to add together the
two sets of date and time fields if they are all present, and calculate their
average. If only the first date and time are present, it should sum them. It
works fine.

However, on a recent occasion a user accidentally deleted row 24 and managed
to change the formula to

=IF(AND(ISNUMBER(L23),ISNUMBER(M23),ISNUMBER(#REF! ),ISNUMBER(#REF!)),(L23+M23+#REF!+#REF!)/2,IF(AND(ISNUMBER(L23),ISNUMBER(M23)),L23+M23,"Not calc."))

Surprisingly (to me) this returned the sum of L23 and M23, and gave the user
an apparently plausible answer that was not noticed for some time. This seems
to be because the formula ISNUMBER(#REF!) does not return an error or #REF!,
just "False".

Please don't suggest protecting the worksheet, because the users have to be
able to delete empty rows. (e.g. if rows 23 and 24 had been both empty, they
would have been deleted).

Can anyone suggest a way to rework the overall formula so that if such
deletion occurs it is obvious that something has gone wrong? Similar
formulae are dotted all over the template, so something simple would be
appreciated!

Many thanks,
Geoff.


  #3   Report Post  
Geoff C
 
Posts: n/a
Default

Thanks!

"bj" wrote:

try
=if(or(iserror(L23),iserror(M23),iserror(L24),iser ror(M24)),"error",IF(AND(ISNUMBER(L23),ISNUMBER(M2 3),ISNUMBER(L24),ISNUMBER(M24)),(L23+M23+L24+M24)/2,IF(AND(ISNUMBER(L23),ISNUMBER(M23)),L23+M23,"Not calc.")))

"Geoff C" wrote:

Hi, hope someone can help. I have a template spreadsheet that contains the
following formula

=IF(AND(ISNUMBER(L23),ISNUMBER(M23),ISNUMBER(L24), ISNUMBER(M24)),(L23+M23+L24+M24)/2,IF(AND(ISNUMBER(L23),ISNUMBER(M23)),L23+M23,"Not calc."))

L23 and L24 are dates, M23 and M24 are times. It's meant to add together the
two sets of date and time fields if they are all present, and calculate their
average. If only the first date and time are present, it should sum them. It
works fine.

However, on a recent occasion a user accidentally deleted row 24 and managed
to change the formula to

=IF(AND(ISNUMBER(L23),ISNUMBER(M23),ISNUMBER(#REF! ),ISNUMBER(#REF!)),(L23+M23+#REF!+#REF!)/2,IF(AND(ISNUMBER(L23),ISNUMBER(M23)),L23+M23,"Not calc."))

Surprisingly (to me) this returned the sum of L23 and M23, and gave the user
an apparently plausible answer that was not noticed for some time. This seems
to be because the formula ISNUMBER(#REF!) does not return an error or #REF!,
just "False".

Please don't suggest protecting the worksheet, because the users have to be
able to delete empty rows. (e.g. if rows 23 and 24 had been both empty, they
would have been deleted).

Can anyone suggest a way to rework the overall formula so that if such
deletion occurs it is obvious that something has gone wrong? Similar
formulae are dotted all over the template, so something simple would be
appreciated!

Many thanks,
Geoff.


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
Formula works in some cells, doesn't in other Wowbagger New Users to Excel 13 June 30th 05 03:21 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
referencing named formula using INDIRECT function [email protected] Excel Worksheet Functions 19 May 11th 05 09:48 AM
Howdo U copy a formula down a column, that uses data in another w. Need Help pasting a formula Excel Worksheet Functions 1 February 25th 05 06:04 PM
Problem with VBA returning the contents of a long formula. [email protected] Excel Discussion (Misc queries) 2 February 23rd 05 12:14 AM


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