+ Reply to Thread
Results 1 to 7 of 7

Formula: Division by Zero or Negavite Number

  1. #1
    Registered User
    Join Date
    12-05-2013
    Location
    nevada, usa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Unhappy Formula: Division by Zero or Negavite Number

    Good Morning,

    I'm working on modifying an existing spreadsheet that have some simple formulas. The two main conditions I need to add to the formula are for handling a divisor of zero or a negative number. You'll see that the initial formulas that were created are for numbers that are exclusively "greater than" or "equal to" zero.

    I can't imagine it's too complicated but I've given it my all for a day now. It'll probably be an "oh duh" moment. At least I hope so.

    The columns with the formulas are D, F, G, H. D is kind-of the anchor in that it's pulls an average from L:N that has to be greater than zero. All other formulas build from there.

    You'll also see that when "E" is negative the remaining formulas won't produce a result.

    Any help would greatly be appreciated. Any additional explaining I need to do please ask.

    Thanks,
    Jason
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Formula: Division by Zero or Negavite Number

    If there is a zero in column D, what would you like in column G as you cannot divide by zero.

    Your current formula states that if E is negative return an empty cell. Do you want something different?

    You've stated your issue, but not what you would like for results. Tell us.

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    12-05-2013
    Location
    nevada, usa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula: Division by Zero or Negavite Number

    Thanks Alan, That would probably help. Lol.

    If D is zero, I would like G to show a zero (to represent no increase), and H to show "fail".

    If E is negative, I'd like F and G to be zero (to show no increase), and H to show "fail".

    I hope that make sense.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Formula: Division by Zero or Negavite Number

    Firstly, change the formula in D to =IF(L2>=0,AVERAGE(L2:N2),0), the zero surrounded by quotations made it text.
    next change formula in G to =IF(D2=0,0,IF(E2>=0,F2/D2,0))
    next change formula in F to =IF(E2>=0,E2-D2,0)

  5. #5
    Registered User
    Join Date
    12-05-2013
    Location
    nevada, usa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula: Division by Zero or Negavite Number

    Hi,

    That worked great. I really appreciate it.

    It looks like I have one more issue to solve. And that is to ammend the formula in H.

    I've attached the document so you can see the instances where it leaves H blank and I'd like it to populate "FAIL" because there is no increase (represented by either F or G).

    I hope I explained that correctly. That where there is zero increase, represented by either F or G, I'd like H to populate "FAIL".

    2013-11 RUNNING PROJECTIONS for forum.xlsx

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Formula: Division by Zero or Negavite Number

    Try this:

    =IF(E2>=0,IF(F2>=1000,IF(G2>=0.3,"PASS","FAIL"),"FAIL"),"FAIL") and copy down.

  7. #7
    Registered User
    Join Date
    12-05-2013
    Location
    nevada, usa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula: Division by Zero or Negavite Number

    Perfect!

    Thanks so much for helping today. I'm excited this is working great!

    -Jason

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Division formula
    By Nubian in forum Excel General
    Replies: 12
    Last Post: 09-03-2012, 10:57 AM
  2. Division formula
    By DODGE in forum Excel General
    Replies: 0
    Last Post: 12-04-2011, 05:24 PM
  3. division gives wrong answer (division)
    By Brice in forum Excel General
    Replies: 5
    Last Post: 12-24-2010, 10:13 PM
  4. DYnamic division of column sum by the number of entries
    By jasonec in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-19-2007, 04:55 PM
  5. division formula
    By Terrie in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-08-2005, 08:06 PM

Tags for this Thread

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