FORMAT.FRACTION (Number, DenominatorDigitCount?, Denominator?, SkipGrouping?, IntegerDigitsMinimum?, Locale?) FORMAT.FRACTION (Number; DenominatorDigitCount?; Denominator?; SkipGrouping?; IntegerDigitsMinimum?; Locale?)

Number

Number Number

The number to format.

DenominatorDigitCount

Number Number (optional)

The number of digits the denominator of the fraction should have. This parameter must be set to BLANK () BLANK () or be omitted if a specific denominator should be used. In that case, the Denominator parameter must be provided.

Denominator

Number Number (optional)

The denominator of the fraction. This parameter must be set to BLANK () BLANK () or be omitted if the denominator is only specified in terms of the number of digits it should have. In that case, the DenominatorDigitCount parameter must be provided.

SkipGrouping

Logical Logical (optional)

FALSE to include thousands separators and TRUE to exclude them. If omitted, FALSE is assumed.

IntegerDigitsMinimum

Number Number (optional)

The minimum number of digits the integer part should be formatted with. If this parameter is greater than the number of digits of the integer part, it is padded with zeroes, meaning that 123 formatted with a minimum of five integer digits is rendered as "00123." If omitted, 1 is assumed.

Locale

Locale Locale (optional)

The locale to use when doing the conversion.

A locale represents a language and possibly a region. If omitted, the configured locale is used.

Use a value such as Locale.EnglishLocale,English to provide a locale (the full list is below). If your chosen locale is not part of the list, use the LOCALE function instead.

All locales may not be available. If a locale is not available, a fallback locale can be used. To provide such fallback locales, use the LOCALE function.

The LOCALE function accepts so-called Unicode Locale Identifiers. Every value in the list below corresponds to such an identifier.

Supported locales
Formula Unicode Locale Identifier Description
Locale.ArabicLocale,Arabic ar Arabic
Locale.BulgarianLocale,Bulgarian bg Bulgarian
Locale.ChineseCnLocale,ChineseCn zh-CN Chinese (simplified), as used in mainland China
Locale.ChineseTwLocale,ChineseTw zh-TW Chinese (traditional), as used in Taiwan
Locale.CroatianLocale,Croatian hr Croatian
Locale.CzechLocale,Czech cs Czech
Locale.DanishLocale,Danish da Danish
Locale.DutchLocale,Dutch nl Dutch
Locale.DutchBeLocale,DutchBe nl-BE Dutch, as used in Belgium
Locale.EnglishLocale,English en English
Locale.EnglishAuLocale,EnglishAu en-AU English, as used in Australia
Locale.EnglishCaLocale,EnglishCa en-CA English, as used in Canada
Locale.EnglishInLocale,EnglishIn en-IN English, as used in India
Locale.EnglishNzLocale,EnglishNz en-NZ English, as used in New Zealand
Locale.EnglishUkLocale,EnglishUk en-GB English, as used in the United Kingdom
Locale.EnglishUsLocale,EnglishUs en-US English, as used in the United States of America
Locale.EnglishZaLocale,EnglishZa en-ZA English, as used in South Africa
Locale.FinnishLocale,Finnish fi Finnish
Locale.FrenchLocale,French fr French
Locale.FrenchBeLocale,FrenchBe fr-BE French, as used in Belgium
Locale.FrenchCaLocale,FrenchCa fr-CA French, as used in Canada
Locale.FrenchChLocale,FrenchCh fr-CH French, as used in Switzerland
Locale.GermanLocale,German de German
Locale.GermanAtLocale,GermanAt de-AT German, as used in Austria
Locale.GermanChLocale,GermanCh de-CH German, as used in Switzerland
Locale.GreekLocale,Greek el Greek
Locale.HebrewLocale,Hebrew he Hebrew
Locale.HindiLocale,Hindi hi Hindi
Locale.HungarianLocale,Hungarian hu Hungarian
Locale.IndonesianLocale,Indonesian id Indonesian
Locale.ItalianLocale,Italian it Italian
Locale.ItalianChLocale,ItalianCh it-CH Italian, as used in Switzerland
Locale.JapaneseLocale,Japanese ja Japanese
Locale.KoreanLocale,Korean ko Korean
Locale.NorwegianLocale,Norwegian nb Norwegian (bokmål)
Locale.PersianLocale,Persian fa Persian
Locale.PolishLocale,Polish pl Polish
Locale.PortugueseLocale,Portuguese pt Portuguese
Locale.PortugueseBrLocale,PortugueseBr pt-BR Portuguese, as used in Brazil
Locale.RomanianLocale,Romanian ro Romanian
Locale.RussianLocale,Russian ru Russian
Locale.SlovakLocale,Slovak sk Slovak
Locale.SpanishLocale,Spanish es Spanish
Locale.SpanishArLocale,SpanishAr es-AR Spanish, as used in Argentina
Locale.SpanishEsLocale,SpanishEs es-ES Spanish, as used in Spain
Locale.SpanishMxLocale,SpanishMx es-MX Spanish, as used in Mexico
Locale.SwedishLocale,Swedish sv Swedish
Locale.ThaiLocale,Thai th Thai
Locale.TurkishLocale,Turkish tr Turkish
Locale.UkrainianLocale,Ukrainian uk Ukrainian
Locale.VietnameseLocale,Vietnamese vi Vietnamese

Returns

Text Text

A formatted textual representation of a number, which includes an integer followed by a fraction.

Returns a number as text, formatted as an integer followed by a fraction (a denominator, a division symbol and a numerator). FORMAT.FRACTION (3.75, 1) FORMAT.FRACTION (3,75; 1) returns "3 3/4".

In the preceding example, the second parameter is set to 1, specifying the number of digits in the denominator (the number to the right of the "/" symbol). FORMAT.FRACTION (3.66, 1) FORMAT.FRACTION (3,66; 1) returns "3 2/3" and FORMAT.FRACTION (3.66, 2) FORMAT.FRACTION (3,66; 2) returns "3 33/50".

This function is not commonly supported by spreadsheets.

Setting the denominator explicitly

The denominator can also be set explicitly, ensuring that eights or sixteenths are returned, for instance. When the denominator is given explicitly as the third parameter, the second parameter must be set to BLANK () BLANK () or be omitted.

To specify a denominator while omitting the second parameter, the denominator parameter must be named. To name a parameter, precede its value with its name and : .

These equivalent formulas return "3 3/4" (because 3.66 is closer to "3 3/4" than to either "3 2/4" or "4 0/4"):

FORMAT.FRACTION (3.66, BLANK (), 4)
FORMAT.FRACTION (3,66; BLANK (); 4)

FORMAT.FRACTION (3.66, Denominator: 4)
FORMAT.FRACTION (3,66; Denominator: 4)

These equivalent formulas return "3 5/8":

FORMAT.FRACTION (3.66, BLANK (), 8)
FORMAT.FRACTION (3,66; BLANK (); 8)

FORMAT.FRACTION (3.66, Denominator: 8)
FORMAT.FRACTION (3,66; Denominator: 8)

Finally, these equivalent formulas return "3 11/16":

FORMAT.FRACTION (3.66, BLANK (), 16)
FORMAT.FRACTION (3,66; BLANK (); 16)

FORMAT.FRACTION (3.66, Denominator: 16)
FORMAT.FRACTION (3,66; Denominator: 16)

Thousands separators

This formula returns "1,024 4/5" if the configured locale is US English and "1.024 4/5" if the configured locale is Spanish:

FORMAT.FRACTION (1024.816, 1)
FORMAT.FRACTION (1024,816; 1)

By default, FORMAT.FRACTION includes thousands separators, meaning that a special character is used to separate groups of thousands (" " for US English and "." for Spanish).

The fourth parameter, SkipGrouping , may be set to TRUE to prevent thousands separators from being used. This formula returns "1024 4/5", regardless of the configured locale:

FORMAT.FRACTION (1024.816, 1, BLANK (), TRUE)
FORMAT.FRACTION (1024,816; 1; BLANK (); TRUE)

If the second and fourth parameters are both specified, the third parameter must be given as BLANK () BLANK (). Alternatively, the fourth parameter can be named explicitly in the formula:

FORMAT.FRACTION (1024.816, 1, SkipGrouping: TRUE)
FORMAT.FRACTION (1024,816; 1; SkipGrouping: TRUE)

Padding the integer with leading zeroes

The fifth parameter, IntegerDigitsMinimum , may be used to pad the number with leading zeroes. These equivalent formulas return "0003 3/4":

FORMAT.FRACTION (3.75, 1, BLANK (), TRUE, 4)
FORMAT.FRACTION (3,75; 1; BLANK (); TRUE; 4)

FORMAT.FRACTION (3.75, 1, SkipGrouping: TRUE, IntegerDigitsMinimum: 4)
FORMAT.FRACTION (3,75; 1; SkipGrouping: TRUE; IntegerDigitsMinimum: 4)

Related functions

  • Use FORMAT to format regular numbers.
  • Use FORMAT.CURRENCY to format monetary values (-0.75 can be formatted as "($0.75)").
  • Use FORMAT.PERCENTAGE to format percentages (0.75 can be formatted as "75%").
  • Use FORMAT.SCIENTIFIC to use scientific notation (15,000 can be formatted as "1.5E4").
  • Use FORMAT.ENGINEERING to use engineering notation (15,000 can be formatted as "15E3").
  • Use FIXED to round a number to the left of the decimal separator (7,523 can be formatted as "7,500").

Examples

FORMAT.FRACTION (3.75, 1)
FORMAT.FRACTION (3,75; 1)

Returns "3 3/4". The number of digits of the denominator (appearing to the right of the "/" symbol) is set to 1.

FORMAT.FRACTION ({ 3.75, 2.75 }, 1)
FORMAT.FRACTION ({ 3,75; 2,75 }; 1)

Returns the array { "3 3/4", "2 3/4" }{ "3 3/4"; "2 3/4" }. The number of digits of the denominator (appearing to the right of the "/" symbol) is set to 1. When invoked with an array, FORMAT.FRACTION is invoked once per array element and the results are collected in an array.

FORMAT.FRACTION (3.66, 1)
FORMAT.FRACTION (3,66; 1)

Returns "3 2/3". The number of digits of the denominator (appearing to the right of the "/" symbol) is set to 1.

FORMAT.FRACTION (3.66, 2)
FORMAT.FRACTION (3,66; 2)

Returns "3 33/50". The number of digits of the denominator (appearing to the right of the "/" symbol) is set to 2.

FORMAT.FRACTION (3.66, BLANK (), 4)
FORMAT.FRACTION (3,66; BLANK (); 4)

Returns "3 3/4" (because 3.66 is closer to "3 3/4" than to either "3 2/4" or "4 0/4".) The denominator is set explicitly to 4.

FORMAT.FRACTION (3.66, BLANK (), 8)
FORMAT.FRACTION (3,66; BLANK (); 8)

Returns "3 5/8". The denominator is set explicitly to 8.

FORMAT.FRACTION (3.66, BLANK (), 16)
FORMAT.FRACTION (3,66; BLANK (); 16)

Returns "3 11/16". The denominator is set explicitly to 16.

FORMAT.FRACTION (3.66, Denominator: 16)
FORMAT.FRACTION (3,66; Denominator: 16)

Returns "3 11/16". The denominator is set explicitly to 16 by naming the Denominator parameter. As the third parameter is named, the second optional parameter is not needed and can be left out.

FORMAT.FRACTION (1024.816, 1)
FORMAT.FRACTION (1024,816; 1)

Returns "1,024 4/5" if the configured locale is US English. "1.024 4/5" is returned if the configured locale is Spanish.

FORMAT.FRACTION (1024.816, 1, Locale: Locale.Spanish)
FORMAT.FRACTION (1024,816; 1; Locale: Locale,Spanish)

Returns "1.024 4/5".

FORMAT.FRACTION (1024.816, 1, BLANK (), TRUE)
FORMAT.FRACTION (1024,816; 1; BLANK (); TRUE)

Returns "1024 4/5", without a thousands separator.

FORMAT.FRACTION (3.75, 1, BLANK (), TRUE, 4)
FORMAT.FRACTION (3,75; 1; BLANK (); TRUE; 4)

Returns "0003 3/4", using at least four digits for the integer part of the fraction, padding the number with leading zeroes if needed.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell