#1   Report Post  
Posted to microsoft.public.excel.programming
PD PD is offline
external usenet poster
 
Posts: 18
Default Max

Hi,

I need a formula that calculates the max value only if the cell has a value
0 and also ignores the #NA error.


The file has a column with formula which through up a #NA error if the
lookup field is empty. The Max formula should still calcuate the maximum
value in the column and ignore the celss with the #NA error.

ie, if the cell A3:A6 contain the following values:

A3 1
A4 #NA
A5 2
A6 #NA

Max(a3:A6) will give the result - #NA. I need a formula that will give the
result - 2.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,358
Default Max

**array** formula
=MAX(IF(ISNA(A3:A6),0,A3:A6))
CTRL+Shift+Enter to enter an array formula.
Unless you are searching for a VBA solution here.
--
** John C **


"PD" wrote:

Hi,

I need a formula that calculates the max value only if the cell has a value
0 and also ignores the #NA error.


The file has a column with formula which through up a #NA error if the
lookup field is empty. The Max formula should still calcuate the maximum
value in the column and ignore the celss with the #NA error.

ie, if the cell A3:A6 contain the following values:

A3 1
A4 #NA
A5 2
A6 #NA

Max(a3:A6) will give the result - #NA. I need a formula that will give the
result - 2.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Max

Hi,

Try

=MAX(IF(ISNUMBER(A3:A6),A3:A6))

This an array which must be entered with CTRL+Shift+Enter and NOT just
enter. If you do it correctly then Excel will put curly brackets around the
formula{}. You can't type these yourself.

Mike

"PD" wrote:

Hi,

I need a formula that calculates the max value only if the cell has a value
0 and also ignores the #NA error.


The file has a column with formula which through up a #NA error if the
lookup field is empty. The Max formula should still calcuate the maximum
value in the column and ignore the celss with the #NA error.

ie, if the cell A3:A6 contain the following values:

A3 1
A4 #NA
A5 2
A6 #NA

Max(a3:A6) will give the result - #NA. I need a formula that will give the
result - 2.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,358
Default Max

What if the numbers in the series are -3 and -5?
--
** John C **

"Mike H" wrote:

Hi,

Try

=MAX(IF(ISNUMBER(A3:A6),A3:A6))

This an array which must be entered with CTRL+Shift+Enter and NOT just
enter. If you do it correctly then Excel will put curly brackets around the
formula{}. You can't type these yourself.

Mike

"PD" wrote:

Hi,

I need a formula that calculates the max value only if the cell has a value
0 and also ignores the #NA error.


The file has a column with formula which through up a #NA error if the
lookup field is empty. The Max formula should still calcuate the maximum
value in the column and ignore the celss with the #NA error.

ie, if the cell A3:A6 contain the following values:

A3 1
A4 #NA
A5 2
A6 #NA

Max(a3:A6) will give the result - #NA. I need a formula that will give the
result - 2.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Max

Then it will select the larger -5. your point being

"John C" wrote:

What if the numbers in the series are -3 and -5?
--
** John C **

"Mike H" wrote:

Hi,

Try

=MAX(IF(ISNUMBER(A3:A6),A3:A6))

This an array which must be entered with CTRL+Shift+Enter and NOT just
enter. If you do it correctly then Excel will put curly brackets around the
formula{}. You can't type these yourself.

Mike

"PD" wrote:

Hi,

I need a formula that calculates the max value only if the cell has a value
0 and also ignores the #NA error.

The file has a column with formula which through up a #NA error if the
lookup field is empty. The Max formula should still calcuate the maximum
value in the column and ignore the celss with the #NA error.

ie, if the cell A3:A6 contain the following values:

A3 1
A4 #NA
A5 2
A6 #NA

Max(a3:A6) will give the result - #NA. I need a formula that will give the
result - 2.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Max

or -3 even

"John C" wrote:

What if the numbers in the series are -3 and -5?
--
** John C **

"Mike H" wrote:

Hi,

Try

=MAX(IF(ISNUMBER(A3:A6),A3:A6))

This an array which must be entered with CTRL+Shift+Enter and NOT just
enter. If you do it correctly then Excel will put curly brackets around the
formula{}. You can't type these yourself.

Mike

"PD" wrote:

Hi,

I need a formula that calculates the max value only if the cell has a value
0 and also ignores the #NA error.

The file has a column with formula which through up a #NA error if the
lookup field is empty. The Max formula should still calcuate the maximum
value in the column and ignore the celss with the #NA error.

ie, if the cell A3:A6 contain the following values:

A3 1
A4 #NA
A5 2
A6 #NA

Max(a3:A6) will give the result - #NA. I need a formula that will give the
result - 2.

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 05:47 AM.

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"