+ Reply to Thread
Results 1 to 8 of 8

#divby0 help

  1. #1
    Registered User
    Join Date
    04-06-2020
    Location
    South africa, Pretoria
    MS-Off Ver
    2013
    Posts
    22

    #divby0 help

    So i have this small problem.

    lest say i have field a-b and c

    a b c
    0 0 #DIV/0!
    0 10 1
    10 0 -10
    12 6 .5
    I am trying to get growth. The only one that works is if there is data in both. if both values is 0 i need o
    if first value has data and second value has 0 then it should be -100
    if first value has no data but second hone has data then it should be 100

    at this moment the code is
    Please Login or Register  to view this content.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: #divby0 help

    I am trying to get growth. The only one that works is if there is data in both. if both values is 0 i need o
    if first value has data and second value has 0 then it should be -100
    if first value has no data but second hone has data then it should be 100
    What if both have values?

    =IF(AND(A2=0,B2=0),0, IF(AND(A2>0,B2=0),-100,IF(AND(A2=0,B2>0),100,"Both have values")))
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    04-06-2020
    Location
    South africa, Pretoria
    MS-Off Ver
    2013
    Posts
    22

    Re: #divby0 help

    if both has values it should be (d-c)/c

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: #divby0 help

    where did D column come from ?

  5. #5
    Registered User
    Join Date
    04-06-2020
    Location
    South africa, Pretoria
    MS-Off Ver
    2013
    Posts
    22

    Re: #divby0 help

    ok -d is my live excell (b-a)/a

    the code in my macro is
    Please Login or Register  to view this content.

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: #divby0 help

    not doing via a macro sorry , missed that forum
    using a function
    =IF(AND(A2=0,B2=0),0, IF(AND(A2>0,B2=0),-100,IF(AND(A2=0,B2>0),100,(B2-A2)/A2)))

  7. #7
    Registered User
    Join Date
    04-06-2020
    Location
    South africa, Pretoria
    MS-Off Ver
    2013
    Posts
    22

    Re: #divby0 help

    IF(AND(RC[-2]=0,RC[-3]=0),0,IF(AND(RC[-2]>0,RC[-3]=0),-100,IF(AND(RC[-2]=0,RC[-3]>0),100,IF(AND(RC[-2]>0,RC[-3]>0),(RC[-2]-RC[-3])/RC[-2]))))

    Here is the full code, thanks would not have gotten it right without your help

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: #divby0 help

    glad that worked ok for you

+ 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