The list of values supported for the "format" argument is far shorter than the list of possible numeric formats. What happens if CELL("format", A1) is called on a cell with a format not on this list

Specify what happens in this case.

CELL Part 4, Section 3.17.7.34

te

Proposed Disposition of DIS 29500 Comment CL-0171 (Modified: 2007-12-07) Agreed; the following changes will be made to Part 4, §3.17.7.34: Part 4, §3.17.7.34, page 2,561, format argument category Meaning Result Type "format" Number format of the cell. (See the table discussion of formats below.) text Part 4, §3.17.7.34, page 2,561, line 1 and page 2,562, top Format Number Format String 0 "F0" 0.00 "F2" #,##0 ",0" #,##0.00 ",2" $#,##0_);($#,##0) "C0" $#,##0_);[Red]($#,##0) "C0-" $#,##0.00_);($#,##0.00) "C2" $#,##0.00_);[Red]($#,##0.00) "C2-" 0% "P0" 0.00% "P2" 0.00E+00 "S2" General "G" # ?/? # ??/?? "G" d-mmm-yy dd-mmm-yy "D1" d-mmm dd-mmm "D2" mmm-yy "D3" m/d/yy "D4" Format Number Format String m/d/yy h:mm mm/dd/yy mm/dd "D5" h:mm:ss AM/PM "D6" h:mm AM/PM "D7" h:mm:ss "D8" h:mm "D9" Part 4, §3.17.7.34, page 2,562, between lines 4 and 5 When the category parameter is "format", then the value returned depends upon the number format of the upper-left cell of reference, and more specifically upon the number format code of the upper-left cell of reference. Depending upon the number format code of the appropriate cell, the result value of CELL when the category is "format" is based upon the rules defined below. First, some observations regarding the rules are in order: The various "sections" of the number format code are referred to within the rules. For more information on sections in the number format code, see numFmts (Number Formats) (§3.8.31). There are cases where it is useful to discuss the characters from the number format code which are dependent upon the value in the cell. These characters, instead of representing text or spacing in the cell’s display text, interpret, in some fashion, the value to be displayed. In the rules, these characters are referred to as "interpreted characters" of the number format code. The following table shows all the interpreted characters: Interpreted Characters 0 # @ D M Y H S ? AM/PM Interpreted Characters A/P G E R There are cases where it is also useful to discuss runs of similar interpreted characters. For example, each "d", "m", and "y" within the number format code "dd/mm/yyyy" does not represent a separate interpretation of the day of the date value to be represented, and instead helps to make up a representation of the day of the date that is two digits in length. These runs of similar characters will be referred to below as “interpreted symbols” since multiple characters are used, but the result is a single symbolic representation of at least part of the value. Since there are multiple different symbols for days, months, years, hours, minutes, seconds, and AM/PM, it is sometimes useful to discuss all of the representations of each of these. When any of "Day", "Month", "Year", "Hour", "Minute", etc. is referred to within a rule, what is meant is any of the possible representations for that date/time portion. For example, a “Day” symbol would be any of d, dd, ddd, or dddd. The use of characters such as "0", "E", and "%" as a symbol within a number format code does not include usages of these same characters either escaped (by preceding them with a backslash character “\”) or as a part of a quoted string. Here are the rules to determine the result value: 1. If the first interpreted symbols within the first section are any of the date or time characters (any of "y", "m", "d", "h", "m", "s") then the first one or two characters of the return value are determined by the order of interpreted symbols (including any interpreted symbols, not just date/time symbols) according to the following table ("anything" can mean "no additional symbols. " If the type is "anything except <type>", then the excepted symbol type cannot follow the previously specified symbol): Interpreted Symbols in Order Return Value Characters Day, month, year, anything "D1" Day, month, anything besides year, anything "D2" Month, year, anything "D3" Month, day, year, anything "D4" Interpreted Symbols in Order Return Value Characters Month, day, anything besides year, anything "D5" Hours, minutes, seconds, AM/PM, anything "D6" Hours, minutes, AM/PM, anything "D7" Hours, minutes, seconds, anything besides AM/PM, anything "D8" Hours, minutes, anything besides seconds or AM/PM, anything "D9" Any other combination of symbols "G" or "C" depending on whether there is a $ in the first condition 2. Otherwise, the first character of the return value is determined based upon the referenced cell’s number format code according to the rules in the table below: First Section of the Number Format Code First Return Value Character Absent Characters (as Symbols) Present Characters (as Symbols) @ "G" @ $ "C" @, $ % "P" @, $, % E "S" @, $, %, E A run of any combination of one or more "0", "#", and "?" characters, followed by a comma, followed by a run of any combination of one or more "0", "#", and "?" characters. This run can not be preceded by a period (".") or by any interpreted characters. "," @, $, %, E, or a run of characters containing a comma as described in the row above At least one of "0", "?", or "#" "F" Any of the above conditions Anything "G" 3. The final value is determined by appending any of the applicable characters from the table below to the return value characters obtained from the previous two tables: Case Characters to Append The first character of the return value is C, F, S, P, or "," and the number format code contains any of "?", "0", or "#" as a symbol. The decimal number equal to the total number of "#", "?", and "0" characters to the right of the first "." within the first section The first character of the return value was C, and the number format code does not contains any of "?", "0", or "#" as a symbol. 15 or the length of the string immediately following the first "$" sign in the number format code that is a symbol. The first section of the number format code contains an open parenthesis ("(") as a symbol. "()" The second section of the number format code contains [Red], [Black], [Green], [White], [Blue], [Magenta], [Yellow], or [Cyan] as a symbol. "-" Similar Comments: CO-0167 , FR-0495 , GB-0379 , GR-0105 , US-0179

Tag and Go

No Comments

Sorry, the comment form is closed at this time.

  • Argentina (1)
  • Australia (30)
  • Austria (1)
  • Belgium (1)
  • Brazil (64)
  • Bulgaria (3)
  • Canada (79)
  • Chile (217)
  • China (1)
  • Colombia (237)
  • Czech Republic (75)
  • Denmark (168)
  • Ecma (76)
  • Ecuador (1)
  • Finland (15)
  • France (592)
  • Germany (162)
  • Ghana (12)
  • Greece (113)
  • India (82)
  • Iran (58)
  • Ireland (12)
  • Israel (33)
  • Italy (2)
  • Japan (82)
  • Jordan (1)
  • Kenya (81)
  • Malaysia (23)
  • Malta (5)
  • Mexico (7)
  • New Zealand (54)
  • Norway (12)
  • Peru (10)
  • Philippines (7)
  • Poland (4)
  • Portugal (118)
  • Singapore (2)
  • South Africa (17)
  • South Korea (25)
  • Spain (1)
  • Switzerland (19)
  • Thailand (1)
  • Tunisia (3)
  • Turkey (1)
  • UK (635)
  • Uruguay (18)
  • USA (288)
  • Venezuela (73)