+ Reply to Thread
Results 1 to 8 of 8

Division By Zero

  1. #1
    carl
    Guest

    Division By Zero

    In this formula: = b24/b5

    If b5 is blank or zero, can the formula be written so that it will return
    "NoOrders" ?

    Thank you in advance.

  2. #2
    Aladin Akyurek
    Guest

    Re: Division By Zero

    =IF(N(B5),B24/B5,"NoOrders")

    carl wrote:
    > In this formula: = b24/b5
    >
    > If b5 is blank or zero, can the formula be written so that it will return
    > "NoOrders" ?
    >
    > Thank you in advance.


  3. #3
    Myrna Larson
    Guest

    Re: Division By Zero

    Hi, Aladin:

    I was going to say that doesn't work for me, but surprisingly (to me), it
    does!

    According to the documentation for the N function, it shouldn't work. If I
    type a 0 in B5, then write in another cell the formula =N(B5), I get 0. But
    your formula returns NoOrders.

    The question is, WHY? Let's say you have 100 in B24 and 0 in B5. N tests
    whether 0 is a number, which it is. Therefore the formula *should* return
    100/0, and ultimately a divide-by-zero error.

    OTOH, if you change the formula to

    =IF(N(B24/B5),B24/B5,"NoOrders")

    you get #DIV/0! rather than NoOrders. B24/B5 in this case returns an error
    value, and N(B24/B5) returns that same error value, #DIV/0! IF seems to treat
    this error result as non-0, and returns the result of B24/B5, or an error.

    I find this behavior to be very bizarre and counter-intuitive.

    I would use a formula that doesn't produce all of these "surprises", maybe
    something like

    =IF(ISERROR(B24/B5),"NoOrders",B24/B5)



    On Mon, 26 Sep 2005 19:41:11 +0200, Aladin Akyurek <[email protected]> wrote:

    >=IF(N(B5),B24/B5,"NoOrders")
    >
    >carl wrote:
    >> In this formula: = b24/b5
    >>
    >> If b5 is blank or zero, can the formula be written so that it will return
    >> "NoOrders" ?
    >>
    >> Thank you in advance.


  4. #4
    Aladin Akyurek
    Guest

    Re: Division By Zero

    Myrna,

    If the condition part in a IF formula evaluates to 0, which means FALSE
    while a non-zero numeric result is taken as TRUE, and N(0)=0, IF will
    proceed to its then-part.

    Aladin

    Myrna Larson wrote:
    > Hi, Aladin:
    >
    > I was going to say that doesn't work for me, but surprisingly (to me), it
    > does!
    >
    > According to the documentation for the N function, it shouldn't work. If I
    > type a 0 in B5, then write in another cell the formula =N(B5), I get 0. But
    > your formula returns NoOrders.
    >
    > The question is, WHY? Let's say you have 100 in B24 and 0 in B5. N tests
    > whether 0 is a number, which it is. Therefore the formula *should* return
    > 100/0, and ultimately a divide-by-zero error.
    >
    > OTOH, if you change the formula to
    >
    > =IF(N(B24/B5),B24/B5,"NoOrders")
    >
    > you get #DIV/0! rather than NoOrders. B24/B5 in this case returns an error
    > value, and N(B24/B5) returns that same error value, #DIV/0! IF seems to treat
    > this error result as non-0, and returns the result of B24/B5, or an error.
    >
    > I find this behavior to be very bizarre and counter-intuitive.
    >
    > I would use a formula that doesn't produce all of these "surprises", maybe
    > something like
    >
    > =IF(ISERROR(B24/B5),"NoOrders",B24/B5)
    >
    >
    >
    > On Mon, 26 Sep 2005 19:41:11 +0200, Aladin Akyurek <[email protected]> wrote:
    >
    >
    >>=IF(N(B5),B24/B5,"NoOrders")
    >>
    >>carl wrote:
    >>
    >>>In this formula: = b24/b5
    >>>
    >>>If b5 is blank or zero, can the formula be written so that it will return
    >>>"NoOrders" ?
    >>>
    >>>Thank you in advance.


  5. #5
    Sandy Mann
    Guest

    Re: Division By Zero

    Myrna,

    I'm not, (can't), trying to answer for Aladin, but I don't understand what
    you mean by:

    > According to the documentation for the N function, it shouldn't work


    My Help says for N:

    *************************
    If value is or refers to N returns
    A number That number
    ************************

    If N returns a 0 then it is the same as:

    =IF(0,"Alex","Sandy")

    which will return "Sandy"

    Why do you find it counter-intuitive?

    --
    Puzzled,


    Sandy
    [email protected]
    Replace@mailinator with @tiscali.co.uk


    "Myrna Larson" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, Aladin:
    >
    > I was going to say that doesn't work for me, but surprisingly (to me), it
    > does!
    >
    > According to the documentation for the N function, it shouldn't work. If I
    > type a 0 in B5, then write in another cell the formula =N(B5), I get 0.
    > But
    > your formula returns NoOrders.
    >
    > The question is, WHY? Let's say you have 100 in B24 and 0 in B5. N tests
    > whether 0 is a number, which it is. Therefore the formula *should* return
    > 100/0, and ultimately a divide-by-zero error.
    >
    > OTOH, if you change the formula to
    >
    > =IF(N(B24/B5),B24/B5,"NoOrders")
    >
    > you get #DIV/0! rather than NoOrders. B24/B5 in this case returns an error
    > value, and N(B24/B5) returns that same error value, #DIV/0! IF seems to
    > treat
    > this error result as non-0, and returns the result of B24/B5, or an error.
    >
    > I find this behavior to be very bizarre and counter-intuitive.
    >
    > I would use a formula that doesn't produce all of these "surprises", maybe
    > something like
    >
    > =IF(ISERROR(B24/B5),"NoOrders",B24/B5)
    >
    >
    >
    > On Mon, 26 Sep 2005 19:41:11 +0200, Aladin Akyurek <[email protected]>
    > wrote:
    >
    >>=IF(N(B5),B24/B5,"NoOrders")
    >>
    >>carl wrote:
    >>> In this formula: = b24/b5
    >>>
    >>> If b5 is blank or zero, can the formula be written so that it will
    >>> return
    >>> "NoOrders" ?
    >>>
    >>> Thank you in advance.




  6. #6
    Myrna Larson
    Guest

    Re: Division By Zero

    Because my Alzheimer's is flaring up today???

    On Mon, 26 Sep 2005 21:18:58 +0100, "Sandy Mann" <[email protected]>
    wrote:

    >Myrna,
    >
    >I'm not, (can't), trying to answer for Aladin, but I don't understand what
    >you mean by:
    >
    >> According to the documentation for the N function, it shouldn't work

    >
    >My Help says for N:
    >
    >*************************
    >If value is or refers to N returns
    >A number That number
    >************************
    >
    >If N returns a 0 then it is the same as:
    >
    >=IF(0,"Alex","Sandy")
    >
    >which will return "Sandy"
    >
    >Why do you find it counter-intuitive?


  7. #7
    Myrna Larson
    Guest

    Re: Division By Zero

    Somehow I must have been thinking about ISNUMBER(B5), even though I was
    reading help on the N() function. As I said, must be a "bad Alzheimer day".

    On Mon, 26 Sep 2005 21:24:22 -0500, Myrna Larson
    <[email protected]> wrote:

    >Because my Alzheimer's is flaring up today???
    >
    >On Mon, 26 Sep 2005 21:18:58 +0100, "Sandy Mann" <[email protected]>
    >wrote:
    >
    >>Myrna,
    >>
    >>I'm not, (can't), trying to answer for Aladin, but I don't understand what
    >>you mean by:
    >>
    >>> According to the documentation for the N function, it shouldn't work

    >>
    >>My Help says for N:
    >>
    >>*************************
    >>If value is or refers to N returns
    >>A number That number
    >>************************
    >>
    >>If N returns a 0 then it is the same as:
    >>
    >>=IF(0,"Alex","Sandy")
    >>
    >>which will return "Sandy"
    >>
    >>Why do you find it counter-intuitive?


  8. #8
    Sandy Mann
    Guest

    Re: Division By Zero

    The doctor said to the patient, "I've got two pieces of bad news for you -
    you've got cancer and Alzhimer's"
    "Oh well," said the patient, "At least I haven't got cancer!" <g>

    --
    Regards


    Sandy
    [email protected]
    Replace@mailinator with @tiscali.co.uk


    "Myrna Larson" <[email protected]> wrote in message
    news:[email protected]...
    > Somehow I must have been thinking about ISNUMBER(B5), even though I was
    > reading help on the N() function. As I said, must be a "bad Alzheimer
    > day".
    >
    > On Mon, 26 Sep 2005 21:24:22 -0500, Myrna Larson
    > <[email protected]> wrote:
    >
    >>Because my Alzheimer's is flaring up today???
    >>
    >>On Mon, 26 Sep 2005 21:18:58 +0100, "Sandy Mann"
    >><[email protected]>
    >>wrote:
    >>
    >>>Myrna,
    >>>
    >>>I'm not, (can't), trying to answer for Aladin, but I don't understand
    >>>what
    >>>you mean by:
    >>>
    >>>> According to the documentation for the N function, it shouldn't work
    >>>
    >>>My Help says for N:
    >>>
    >>>*************************
    >>>If value is or refers to N returns
    >>>A number That number
    >>>************************
    >>>
    >>>If N returns a 0 then it is the same as:
    >>>
    >>>=IF(0,"Alex","Sandy")
    >>>
    >>>which will return "Sandy"
    >>>
    >>>Why do you find it counter-intuitive?




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1