#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default sum if

Hi,

I looking for an easy formula that will do the following procedu

In cell A3

If cell A1 contains a value (0 - infinity) show value of A1, if not show
value in cell A2

Regards Stefan
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default sum if

Try this:

=IF(ISNUMBER(A1),A1,A2)

Hope this helps.

Pete

On Sep 16, 9:54*am, Stefan wrote:
Hi,

I looking for an easy formula that will do the following procedu

In cell A3

If cell A1 contains a value (0 - infinity) show value of A1, if not show
value in cell A2

Regards Stefan


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default sum if

Hi,

try this in a3

=IF(AND(ISNUMBER(A1),A1=0),A1,A2)

Mike

"Stefan" wrote:

Hi,

I looking for an easy formula that will do the following procedu

In cell A3

If cell A1 contains a value (0 - infinity) show value of A1, if not show
value in cell A2

Regards Stefan

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default sum if

"Stefan" wrote:
I looking for an easy formula that will do the following procedu
[....]
If cell A1 contains a value (0 - infinity) show value of A1,
if not show value in cell A2


Often, the following is sufficient:

=IF(A1<"", A1,A2)

But if A1 might contain other text and you want A2 in that case, then you
need:

=IF(ISNUMBER(A1),A1,A2)

I also note that you say "0 to infinity". If A1 might contain a negative
number and you want A2 in that case as well, then you need one of the
following:

=IF(AND(A1<"",A1=0),A1,A2)

=IF(AND(ISNUMBER(A1),A1=0),A1,A2)

Finally, if A1 might contain an Excel error (e.g. #NUM, #DIV/0 or #NA) and
you want A2 in that case as well, then you need one of the following:

=IF(ISNUMBER(A1),A1,A2)

=IF(ISNUMBER(A1),IF(A1=0,A1,A2),A2)

But generally, is preferrable to avoid Excel errors in a cell.


----- original message -----

"Stefan" wrote in message
...
Hi,

I looking for an easy formula that will do the following procedu

In cell A3

If cell A1 contains a value (0 - infinity) show value of A1, if not show
value in cell A2

Regards Stefan


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 11:15 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"