View Single Post
  #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.