Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Radio Ham
 
Posts: n/a
Default Overwriting error message #NUM! with meaningful text

In my Shortwave Skip Distance Predictor I have the formula
=2*D2*SQRT((B2/C2)*(B2/C2)-1) When C2 is greater than B2 (i.e. when the
critical frequency is greater than the user frequency) we end up taking the
square root of a negative number, which gives #NUM! in the Skip Distance
result column. How do I change this error message into a meaningful text
saying NVIS (Near Vertical Incident Skywave)?

From looking at various Excel Guides it seems I need to add some sort of
Macro, but don't know what General Script to write. If someone could write
one for me I would be most grateful. Given this example I think I could cope
with similar cases in the future. Many thanks.
  #2   Report Post  
David Billigmeier
 
Posts: n/a
Default

Add an ISERROR() check first:

=IF(ISERROR(2*D2*SQRT((B2/C2)*(B2/C2)-1)),"NVIS",2*D2*SQRT((B2/C2)*(B2/C2)-1))
--
Regards,
Dave


"Radio Ham" wrote:

In my Shortwave Skip Distance Predictor I have the formula
=2*D2*SQRT((B2/C2)*(B2/C2)-1) When C2 is greater than B2 (i.e. when the
critical frequency is greater than the user frequency) we end up taking the
square root of a negative number, which gives #NUM! in the Skip Distance
result column. How do I change this error message into a meaningful text
saying NVIS (Near Vertical Incident Skywave)?

From looking at various Excel Guides it seems I need to add some sort of
Macro, but don't know what General Script to write. If someone could write
one for me I would be most grateful. Given this example I think I could cope
with similar cases in the future. Many thanks.

  #3   Report Post  
Radio Ham
 
Posts: n/a
Default

It works!!
Regards

"David Billigmeier" wrote:

Add an ISERROR() check first:

=IF(ISERROR(2*D2*SQRT((B2/C2)*(B2/C2)-1)),"NVIS",2*D2*SQRT((B2/C2)*(B2/C2)-1))
--
Regards,
Dave


"Radio Ham" wrote:

In my Shortwave Skip Distance Predictor I have the formula
=2*D2*SQRT((B2/C2)*(B2/C2)-1) When C2 is greater than B2 (i.e. when the
critical frequency is greater than the user frequency) we end up taking the
square root of a negative number, which gives #NUM! in the Skip Distance
result column. How do I change this error message into a meaningful text
saying NVIS (Near Vertical Incident Skywave)?

From looking at various Excel Guides it seems I need to add some sort of
Macro, but don't know what General Script to write. If someone could write
one for me I would be most grateful. Given this example I think I could cope
with similar cases in the future. Many thanks.

  #4   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Note that the formula will mask other errors, too (like an error B2, C2
or D2, or C2=0). It also uses rather more references than necessary. A
slightly more efficient version:

=IF(B2<C2,"NVIS",2*D2*SQRT((B2/C2)^2-1))

In article ,
"David Billigmeier"
wrote:

Add an ISERROR() check first:

=IF(ISERROR(2*D2*SQRT((B2/C2)*(B2/C2)-1)),"NVIS",2*D2*SQRT((B2/C2)*(B2/C2)-1))

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
Spreadsheets are overwriting each other Bryan Excel Discussion (Misc queries) 5 August 12th 05 01:51 PM
Overwriting of linked data kivar Excel Discussion (Misc queries) 0 June 2nd 05 03:04 PM
prevent users from overwriting other users data [email protected] Excel Worksheet Functions 0 April 17th 05 08:18 PM
Overwriting Cells Keith bedford Excel Discussion (Misc queries) 4 March 9th 05 11:46 PM
How do you create a macros without overwriting the previous one y. Gibbie Excel Discussion (Misc queries) 2 November 29th 04 10:09 PM


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