Closed Thread
Results 1 to 9 of 9

Diving with Zero and not getting an error

  1. #1
    Registered User
    Join Date
    02-23-2016
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    65

    Diving with Zero and not getting an error

    Hi,

    I am facing the problem of diving with zero to calculate growth. However, i know that mathematically its not possible, but in case there is a way it'll be a huge help. The data is in the sample document and if anyone could help with it.

    When I calculate growth from FY16-17(=(C3-B3)/B3) and FY17-18(=(D3-C3)/C3) , I get #DIV/0!, Whereas I want 0% for FY16-17 growth and 100% growth for FY17-18.

    Please help!!!
    Attached Files Attached Files
    Last edited by archimaitreya; 01-11-2018 at 03:58 AM.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Diving with Zero and not getting an error

    You can use iferror.

    Something like - =IFERROR((C3-B3)/B3,0) in cell E3
    Cheers!
    Deep Dave

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Diving with Zero and not getting an error

    Or you could just test B3 and C3 for a zero value
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    02-23-2016
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    65

    Re: Diving with Zero and not getting an error

    This doesn't help as it gives me 0% growth as well, when cell D3 has a number and should ideally be a growth of certain percentage in cell F3.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,025

    Re: Diving with Zero and not getting an error

    Since you have replies already from 2 people (now 3...) please specify WHO you are talking to. Is this what you had wanted (based on Post 2)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  6. #6
    Registered User
    Join Date
    02-23-2016
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    65

    Re: Diving with Zero and not getting an error

    Hi, Thanks for this, but this doesn't help as it gives me 0% growth as well, when cell D3 has a number and should ideally be a growth of certain percentage in cell F3.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,025

    Re: Diving with Zero and not getting an error

    That's the same reply as post 4. It STILL doesn't say who you are talking to. Please amend your sheet and repost with further examples showing what you DO mean.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Diving with Zero and not getting an error

    Not only do your replies not say who they are addressing, they don't explain what you expect to get. Your question was how not to get an error when you divide by zero. You've had a few responses with different options answering that question.

    Explain what you mean by
    ... should ideally be a growth of certain percentage in cell F3.
    What certain percentage? How do you WANT to calculate it?

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Diving with Zero and not getting an error

    archimaitreya, this is a duplicate thread and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    You have two threads with the same question and there are people actively posting and you are actively responding. This causes confusion and wasted effort. Please do not do this.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. formatting diving me nuts help
    By nickmorgan in forum Excel General
    Replies: 7
    Last Post: 05-15-2015, 08:09 PM
  2. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  3. This is wonderful, diving deep into the realm of Excel, Macros and VBA
    By pastadr in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-24-2013, 05:34 PM
  4. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  5. Line graph nose diving at end of series
    By LucasBuck in forum Excel General
    Replies: 9
    Last Post: 09-01-2011, 08:39 PM
  6. Diving Shapes into equal points
    By stanysurfer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-31-2010, 08:25 PM
  7. Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM

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