#1   Report Post  
Elan
 
Posts: n/a
Default empty cell

I have a column with formulas.
When formulas return empty cell (""), the chart seems to handle
it as a 0. I do not want to display those data points at all.
I tried to use NA() instead The chart seemed to be o.k but now I have a
problem finding MAX/MIN Values of this column €“ because I have there now both
numbers and #N/A.
Thanks
Elan
  #2   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Elan" wrote in message
...
I have a column with formulas.
When formulas return empty cell (""), the chart seems to handle
it as a 0. I do not want to display those data points at all.
I tried to use NA() instead The chart seemed to be o.k but now I have a
problem finding MAX/MIN Values of this column ?" because I have there now

both
numbers and #N/A.
Thanks
Elan


You can use a UDF like the one below. It will ignore things in the passed
range which are not numbers.

Public Function myMax(ByVal r As Range) As Variant
On Error Resume Next
Dim cell As Range
Dim maxval As Double
Dim ValueFound As Boolean

maxval = -999999999999#
ValueFound = False

For Each cell In r
If cell.Value maxval Then
maxval = cell.Value
ValueFound = True
End If
Next cell

If ValueFound Then
myMax = maxval
Else
myMax = CVErr(xlErrNum)
End If
End Function


  #3   Report Post  
bj
 
Posts: n/a
Default

you can use = max(if(iserror(a1:a20,"",a1:a20)
changing the range to what you need
You can use the min function similarily

"Elan" wrote:

I have a column with formulas.
When formulas return empty cell (""), the chart seems to handle
it as a 0. I do not want to display those data points at all.
I tried to use NA() instead The chart seemed to be o.k but now I have a
problem finding MAX/MIN Values of this column €“ because I have there now both
numbers and #N/A.
Thanks
Elan

  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

Fredrik Wahlgren wrote...
....
You can use a UDF like the one below. It will ignore things in the

passed
range which are not numbers.


Why use a UDF rather than an array formula like

=MAX(IF(ISNUMBER(rng),rng))

?

More generally, if there's missing data in chart series, better to use
separate ranges for chart series and downstream calculations, with the
chart ranges derived from the downstream calculation ranges so that
nonnumbers are converted to #N/A.


Public Function myMax(ByVal r As Range) As Variant


If there were good reason to use a udf, why not make it as flexible as
the built-in MAX function? That is, why isn't the argument a
ParamArray, which would allow variable numbers of arguments as well as
individual numbers and arrays as well as ranges?

  #5   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Harlan Grove" wrote in message
oups.com...
Fredrik Wahlgren wrote...
...
You can use a UDF like the one below. It will ignore things in the

passed
range which are not numbers.


Why use a UDF rather than an array formula like

=MAX(IF(ISNUMBER(rng),rng))

?


Right. Your solution is nicer

/Fredrik




  #6   Report Post  
Elan
 
Posts: n/a
Default

Thanks for your answers, but I still could not calculte Max/min values.
for example: A1=2 A2=8 A3=4 A4=#N/A
how can i find max value?
Note: I can not add another column.


  #7   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Elan" wrote in message
...
Thanks for your answers, but I still could not calculte Max/min values.
for example: A1=2 A2=8 A3=4 A4=#N/A
how can i find max value?
Note: I can not add another column.



Have you tried the UDF?

/Fredrik


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
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
Can I use the contents of a cell to satisfy the result_vector arg. robh_2 Excel Worksheet Functions 3 February 24th 05 08:14 PM
make a cell empty based on condition mpierre Charts and Charting in Excel 2 December 29th 04 01:01 PM
Display a dialog box if cell is empty jst Excel Discussion (Misc queries) 2 December 28th 04 11:59 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 09:15 AM.

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

About Us

"It's about Microsoft Excel"