View Single Post
  #5   Report Post  
Posted to microsoft.public.mac.office.word,microsoft.public.word.mailmerge.fields
John McGhie [MVP - Word and Word Macintosh]
 
Posts: n/a
Default Format Fractions in Mail Merge.

Hi Paul:

In the poster's case, I believe the problem is that the characters are "not
there" to be brought across.

In Excel, FormatCellFractions produces a "generated display" of integers
and fractions. The underlying "value" is still a decimal fraction.

I *was* rather hoping that J.E. Would pay us a visit with an algorithm to
convert decimals to fractions.

Ah hah! Here it is: you have to load the Analysis Toolpack, which is an
optional install so you may have to install it from your Office CD. The
DOLLARFR function converts decimal values to fractional representations.
The syntax for DOLLARFR is:

=DOLLARFR(value,fraction)

where value is the value to convert to decimal, and fraction is the
fractional base. So, assuming the value is in cell D2, the Integer is
=IF(D20, TRUNC(DOLLARFR(D2,16)),0) and if the Integer is in E2 the
Numerator is =IF(D20, (DOLLARFR(D2,16)-E2),0). The IF statement is needed
only if there's a chance the value could be zero or less: the DOLLARFR
function will blow up if it does. Stocks, of course, can't go negative
(fortunately...)

Simple.... It's OK John, we don't need you now, got it thanks... :-)

DOLLARFR requires you to "know" what the Denominator is. Assuming it's
stock prices we're talking about here, you do know this: stocks used to
trade in either quarters, eighths, 16ths or 32nds, and you had to "know"
which unit each one used. The NYSE went all-decimal on Jan 29, 2001, so we
won't have to do this for much longer :-)

But Paul's right: if the poster wants to go to the trouble of constructing
the fractions manually, the fraction slash would work too.

Regrettably, the superscript/subscript will not come across, that will have
to be applied in the Word Main Document. Data Merge brings across string
data, but no formatting. I "hope" it's a Unicode string, but I have not
confirmed that. It may be ANSI, and if it is, the fraction slash won't come
across either. But using the formula above, you get the integer and the
fraction in separate cells. You can bring them into the merge
independently, and include the Fraction Slash character and the Super/Sub
formatting in the Main Document.

Cheers

On 19/3/06 3:24 PM, in article ,
"Paul Berkowitz" wrote:

I suspect that none of this is necessary.

Instead, make your fractions in Excel using the Character Palette. If you're
not familiar with this, go to System Preferences/International/Input Menu
and enable (check) the Character Palette, in Tiger. In Panther, there's a
simple checkbox "Character Palette". In both cases check "Show Input menu in
menu bar" at the bottom. (In Jaguar this was called the Keyboard Menu). Now
you'll see a flag in the main menu bar representing your active language. In
that menu is "Show Character Palette". It appears floating over every app.

In Word, go to the Character Palette. In Tiger, make sure it's set to
Unicode. View Code Tables. (In Panther that's how it's set by default.)

You'll find ΒΌ, Β½, ΒΎ (1/4, 1/2, 3/4) in Latin-1 Supplement at 00BC, 00BD,
00BE. (I've included the versions with "/" here because when those of you in
Windows reply the real fractions may get changed if your newsreader doesn't
honor the ISO-8859-1 character format and insists on sending as us-ascii.)

There are a few more built-in fractions in Number Forms, 2153-215E .

But the best way to do any fraction is to use the (combining) FRACTION
SLASH, Unicode 2044, along with superscripts and subscripts:

ΒΉ„‚ƒ , ΅„‚†, Ά·„‚‚‚ƒ‚„

(1/3, 5/6). These look much better in Excel and Word than they do (here) in
Entourage plain text . YMMV for email and news, particularly if your
newsreader can't do Unicode. Superscript 1, 2, 3 are in Latin-1 Supplement
00B0-00B9, the rest in Superscripts and Subscripts 2070-2089.


--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410