+ Reply to Thread
Results 1 to 5 of 5

Prevent "[n]/[n]" from simplifying to "1"

Hybrid View

PkPioneer72 Prevent "[n]/[n]" from... 10-15-2012, 08:29 PM
PkPioneer72 Correction 10-15-2012, 08:53 PM
PkPioneer72 VBA solutions now welcome 10-15-2012, 09:33 PM
icestationzbra Re: Prevent "[n]/[n]" from... 10-15-2012, 09:49 PM
PkPioneer72 Solved 10-15-2012, 09:54 PM
  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    US
    MS-Off Ver
    2007
    Posts
    4

    Prevent "[n]/[n]" from simplifying to "1"

    I have a task tracker that needs to display the number of people that have completed a task out of how many are supposed to complete the task and what percentage that is. The names are in column B and the tasks are in row 2. The percentage is located in the cell below the fraction. Both cells are coded as such:
    Formula: copy to clipboard
    =TEXT(SUM(C6:C1048576)/COUNTA($B$6:$B$1048576),"###/###") 
    and
    Formula: copy to clipboard
     =C3
    I have to use the TEXT function to prevent the fraction from reducing. However, when the fraction reaches unity, e.g. 38/38, it still displays it as a 1. How do I get it to display [n]/[n]? Additionally, the percentage cell will not display the fraction as a percentage, even though I have formatted it for percentage, it just displays the fraction. How can I get it to convert the fraction into a percentage? CAVEAT: I cannot change the aesthetics of this excel file--the format is being used by other units as well to feed to a higher unit. Therefore, I can't just use the 3 cell approach and other solutions like that. Also, VBA cannot be used because, inevitably, the end user (not me) will likely not press the "enable macros" button. Thanks

    Chris
    Last edited by PkPioneer72; 10-15-2012 at 09:47 PM.

  2. #2
    Registered User
    Join Date
    10-15-2012
    Location
    US
    MS-Off Ver
    2007
    Posts
    4

    Correction

    Correction: Using the TEXT function actually didn't prevent the fractions from simplifying--must have misread a 3/4 as a 2/4. I have removed the TEXT function so it is now coded:
    Formula: copy to clipboard
    =SUM(C6:C1048576)/COUNTA($B$6:$B$1048576)
    On the bright side, now that the value is a number and not text, the percentage cell does not need fixing.
    Last edited by PkPioneer72; 10-15-2012 at 09:48 PM.

  3. #3
    Registered User
    Join Date
    10-15-2012
    Location
    US
    MS-Off Ver
    2007
    Posts
    4

    VBA solutions now welcome

    OK, so, in the interest of solving this problem, if you have a VBA solution, go ahead and send it and I'll just write in big, bold letters somewhere "make sure you enable macros."

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Prevent "[n]/[n]" from simplifying to "1"

    why don't you utilise two different formulae - one for displaying fractions, and the other for displaying percentages...

    for displaying fractions, use:

    =SUM(C6:C1048576)&"/"&COUNTA($B$6:$B$1048576)
    and for percentage:

    =SUM(C6:C1048576)/COUNTA($B$6:$B$1048576)
    wouldn't that work for you?
    Last edited by icestationzbra; 10-16-2012 at 12:29 AM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  5. #5
    Registered User
    Join Date
    10-15-2012
    Location
    US
    MS-Off Ver
    2007
    Posts
    4

    Solved

    Thanks, that works perfectly, and now I know how to insert string into a coded cell

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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