Cell format - fractions

M

Matt

I have a set of cells that show the fraction of #complete/#total. They
are formatted as fractions so that I can custom format them such that
those >=50% turn green and those <50% turn red. The problem is that
for a completion of, say 8/12, excel automatically simplifies to 2/3.
Is is possible for excel to still recognize the cell as a fraction but
not simplify?
 
G

Gary''s Student

You can directly control this by formatting in advance. Let's say you enter
the data in twelths and want it to remain that way:

Format > Cells... > Number > Custom and then enter

# ??/12

Experiment with formats like this. There is a lot more available than just
the standard fraction formats.
 
R

Ron Rosenfeld

I have a set of cells that show the fraction of #complete/#total. They
are formatted as fractions so that I can custom format them such that
those >=50% turn green and those <50% turn red. The problem is that
for a completion of, say 8/12, excel automatically simplifies to 2/3.
Is is possible for excel to still recognize the cell as a fraction but
not simplify?

Here's one approach:

Format the cell as TEXT with a RED font (or however you want the <50%
formatted)

Use this Conditional Format to format the cell green:

Format/Conditional Format/Formula Is:

=LEFT(A1,FIND("/",A1)-1)/MID(A1,FIND("/",A1)+1,5)>=0.5


Another approach would be to enter the numerator and denominator in two
different cells.

Then use VBA to custom format the display cells as fractions with the
appropriate numerator (e.g. ??/#total) and also custom format the cell with the
desired color.


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top