+ Reply to Thread
Results 1 to 6 of 6

Calculating Ratios with Zeros in some cells

  1. #1
    Registered User
    Join Date
    03-10-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    Calculating Ratios with Zeros in some cells

    Hi all,

    I am calculating ratios to show as 1:0 or 3:2 etc using this formula: =IFERROR(CONCATENATE((K2/GCD(K2,N2)),":",((N2/GCD(K2,N2)))),"Nil")... I have a lot of columns that have zeros in them and the formula i am using doesn't seem to work for those...

    Example

    A B
    3 6 should equal: 1:2 works OK
    2 0 should equal: 2:0 my current result: 1:0
    3 0 should equal: 3:0 my current result: 1:0
    0 1 should equal: 0:1 works OK
    0 0 should equal: Nil works OK
    4 1 should equal: 4:1 works OK

    Anything with a zero in the first column comes up as 1:0

    Any help? THANK YOU!

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Calculating Ratios with Zeros in some cells

    Hi,

    Try this formula instead:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hope this helps

  3. #3
    Registered User
    Join Date
    03-10-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Calculating Ratios with Zeros in some cells

    Thanks for your suggestion, unfortunately that doesn't work.. it now only produces "Nil" for everything. Unless i am doing it wrong?

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Calculating Ratios with Zeros in some cells

    It worked for me. OK let me use your cell references from your formula rather than from your example:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If this doesn't work, please upload your workbook

  5. #5
    Registered User
    Join Date
    03-10-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Calculating Ratios with Zeros in some cells

    Sorry, it does work! I just have 24000 formulas so it took a while to process... THANK YOU for your help!!!

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Calculating Ratios with Zeros in some cells

    No problems

    Please don't forget to mark this thread as solved (Thread Tools --> Mark As Solved), and please click on the * next to my post to say thanks

+ 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. calculating average in cells, not including zeros
    By kingy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2014, 03:00 AM
  2. [SOLVED] Average for non-consecutive cells excluding zeros (even when they all contain zeros)
    By pao13 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-05-2012, 04:32 PM
  3. calculating ratios
    By saved1ne in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2011, 03:16 PM
  4. Replies: 2
    Last Post: 02-22-2008, 11:18 AM
  5. [SOLVED] How do I calculate ratios between 2 cells?
    By Excel Novice in forum Excel General
    Replies: 2
    Last Post: 01-17-2005, 12: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