Element, attribute, default and enumeration lists below come from the Transitional schema
sml.xsd of ECMA-376 5th edition Part 4, checked against the prose of Part 1
chapter 18 (both read for this page). Where Microsoft’s
[MS-OI29500] (v20260818) says Excel or Office differs from the standard, the note
follows the row as Excel:. Notes on the other programs
(LibreOffice, Apache POI, openpyxl) come from
their source files, listed under Sources. The whole set of differences is
collected on the overview.
Conditional formatting
conditionalFormatting (18.3.1.18) has the attributes sqref (the cells,
a list of references) and pivot (boolean, default false), and holds one or more
cfRule children, each with a priority. A lower number wins; 1 is the
highest priority (18.3.1.10). A rule with stopIfTrue stops lower-priority rules
from being applied over it when it is true. dxfId indexes the
dxf list of the styles part, which
holds the format to apply.
cfRule attribute | Type, default | Used when type is |
|---|---|---|
type | ST_CfType | always (values below) |
priority | int, required | always |
dxfId | ST_DxfId, optional | all but colorScale, dataBar and iconSet, which carry their own appearance |
stopIfTrue | boolean, false | always |
operator | ST_ConditionalFormattingOperator | cellIs (ignored otherwise) |
text | string | containsText (ignored otherwise) |
timePeriod | ST_TimePeriod | timePeriod (ignored otherwise) |
rank, percent, bottom | unsignedInt; boolean false; boolean false | top10: N, “N percent”, and “bottom N” instead of top |
aboveAverage, equalAverage, stdDev | boolean true; boolean false; int | aboveAverage: false means “below”; equalAverage includes the average itself; a present stdDev makes it an “N standard deviations” rule |
Children, in order: up to three formula (only expression rules support
formula syntax, 18.3.1.10), then one of colorScale, dataBar,
iconSet, then extLst.
type | Meaning (18.18.12) |
|---|---|
expression | a formula; highlighted when it is true |
cellIs | the cell value compared with the formula result using operator |
colorScale, dataBar, iconSet | gradient colours, bars, icons chosen by value |
top10 | top or bottom N, or N percent |
aboveAverage | above or below the average of the range |
uniqueValues, duplicateValues | values that occur once, or more than once |
containsText, notContainsText | like the SEARCH() function on the text |
beginsWith, endsWith | like LEFT() or RIGHT() compared with the text |
containsBlanks, notContainsBlanks | like LEN(TRIM()): a cell of only trimmable characters, or an empty one, is blank |
containsErrors, notContainsErrors | like ISERROR() |
timePeriod | the cell’s underlying value is a date in the period (it need not be formatted as a date) |
operator values: lessThan, lessThanOrEqual, equal,
notEqual, greaterThanOrEqual, greaterThan,
between, notBetween, containsText, notContains,
beginsWith, endsWith. timePeriod values:
today, yesterday, tomorrow, last7Days,
thisMonth, lastMonth, nextMonth, thisWeek,
lastWeek, nextWeek.
cfvo, colorScale, dataBar, iconSet
cfvo (a value object) has type (required: num,
percent, max, min, formula,
percentile), val and gte (boolean, default true; for icon
sets, whether the threshold uses “greater than or equal to”). A colorScale has two or
more cfvo and the same number of color elements, matched in order. A
dataBar has exactly two cfvo, one color,
minLength (default 10), maxLength (default 90) and
showValue (default true). An iconSet has two or more
cfvo, iconSet (default 3TrafficLights1),
showValue (true), percent (true) and reverse (false). The 17
icon sets: 3Arrows, 3ArrowsGray, 3Flags,
3TrafficLights1, 3TrafficLights2, 3Signs,
3Symbols, 3Symbols2, 4Arrows, 4ArrowsGray,
4RedToBlack, 4Rating, 4TrafficLights,
5Arrows, 5ArrowsGray, 5Rating, 5Quarters.
Excel ([MS-OI29500] 2.1.595 to 2.1.611): requires type; requires
operator if and only if the type is a cell comparison, and timePeriod if
and only if the type is timePeriod; requires the formula child except for
colorScale, dataBar and iconSet; treats a missing rank as 0; reads a cfvo
val as a formula; refuses min and max as the type of an
icon set’s cfvo; limits minLength and maxLength to at most
100. The specification states none of these.
Data validation
dataValidations (18.3.1.33) holds one or more dataValidation and has
disablePrompts (false), xWindow, yWindow (the position of
the prompt window) and count. Each dataValidation (18.3.1.32) applies to
the range sqref (required).
| Attribute | Values, default |
|---|---|
type | none (default), whole, decimal, list, date, time, textLength, custom (a formula) |
operator | between (default), notBetween, equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual |
errorStyle | stop (default), warning, information |
allowBlank, showDropDown, showInputMessage, showErrorMessage | boolean, all false. The standard says showDropDown shows a drop-down combo box for a list; see the note below for what programs do |
errorTitle, error, promptTitle, prompt | text of the alert and the input prompt |
imeMode | noControl (default), off, on, disabled, hiragana, fullKatakana, halfKatakana, fullAlpha, halfAlpha, fullHangul, halfHangul; only for Chinese, Japanese and Korean |
Children: formula1 and formula2 (the limits, or the list, or the custom
formula).
Spec says / programs do: the standard’s
showDropDown="1" means “display the drop-down”. LibreOffice reads it as
a “suppress drop-down” flag, with the comment that the attribute name and the ECMA text “are plain
wrong” (worksheetfragment.cxx: mbNoDropDown = getBool(XML_showDropDown)),
like the older BIFF format. Apache POI follows the standard’s wording
(XSSFDataValidation.getSuppressDropDownArrow() returns
!getShowDropDown()). The explorer shows the raw value in a “List drop-down (raw
value)” column of the data validation table, with both readings. [MS-OI29500] has no note on this
attribute, so what Excel itself does is not documented in the sources read.
Excel ([MS-OI29500] 2.1.613, 2.1.614): the prompt is at most 255 characters, the
error message 224, and each title 32; sqref holds 1 to 32767 references;
xWindow and yWindow at most 65535, count at most 65534.
Hyperlinks
hyperlink (18.3.1.47): ref (required, the cell or range),
r:id (a relationship in the sheet’s relationships part that gives an external target),
location (inside the target: a sheet and cell, or a defined name, or an HTML anchor),
tooltip and display (a string different from the cell’s own).
Excel: location and display at most 2084 characters,
tooltip at most 255.
Merged cells
mergeCells (18.3.1.55) has count and one or more
mergeCell with the range in ref (required). The formatting and content
of a merged range are always stored in its top left cell.
Auto filters and sorting
autoFilter has ref, any number of filterColumn and an
optional sortState. A filterColumn has colId (required,
0-based within ref), hiddenButton (false), showButton
(true) and at most one of these criteria:
| Child | Attributes (default) |
|---|---|
filters | blank (false), calendarType (none; values gregorian, gregorianUs, gregorianMeFrench, gregorianArabic, hijri, hebrew, taiwan, japan, thai, korea, saka, gregorianXlitEnglish, gregorianXlitFrench, none); holds filter val items and dateGroupItem (year required, month, day, hour, minute, second, and dateTimeGrouping required: year, month, day, hour, minute, second) |
top10 | top (true), percent (false), val (required), filterVal |
customFilters | and (false); one or two customFilter with operator (equal default; lessThan, lessThanOrEqual, notEqual, greaterThanOrEqual, greaterThan) and val |
dynamicFilter | type (required: null, aboveAverage, belowAverage, tomorrow, today, yesterday, nextWeek, thisWeek, lastWeek, nextMonth, thisMonth, lastMonth, nextQuarter, thisQuarter, lastQuarter, nextYear, thisYear, lastYear, yearToDate, Q1 to Q4, M1 to M12), val, valIso, maxVal, maxValIso |
colorFilter | dxfId, cellColor (true: the fill; false: the font colour) |
iconFilter | iconSet (required, one of the 17 above), iconId |
sortState: ref (required), columnSort (false),
caseSensitive (false), sortMethod (none, stroke,
pinYin), up to 64 sortCondition, each with ref (required),
descending (false), sortBy (value default,
cellColor, fontColor, icon), customList,
dxfId, iconSet (default 3Arrows), iconId.
Excel ([MS-OI29500] 2.1.663 to 2.1.670): dxfId of a colour filter
and val of a filter are required; filters holds
filter items or dateGroupItem items, not both; the
calendarType is ignored and saka is treated as none; missing
month and day mean 1, and missing hour,
minute, second mean 0; a top10 val is 1 to 500
(at least 0 in a pivot table), and a missing filterVal is 0.
Tables
A table part (xl/tables/tableN.xml, root table, 18.5.1.2) is reached from
a sheet’s tableParts. Attributes: id and displayName
(required), name, comment, ref (required),
tableType (worksheet default, xml,
queryTable), headerRowCount (1), totalsRowCount (0),
totalsRowShown (true), insertRow and insertRowShift
(false), published (false), the formatting ids headerRowDxfId,
dataDxfId, totalsRowDxfId, headerRowBorderDxfId,
tableBorderDxfId, totalsRowBorderDxfId, the cell style names
headerRowCellStyle, dataCellStyle, totalsRowCellStyle, and
connectionId. Children, in order: autoFilter, sortState,
tableColumns (one tableColumn per column), tableStyleInfo
(name, showFirstColumn, showLastColumn,
showRowStripes, showColumnStripes), extLst.
tableColumn: id and name (required),
uniqueName, totalsRowFunction (none default,
sum, min, max, average, count,
countNums, stdDev, var, custom),
totalsRowLabel, queryTableFieldId, the same dxf and cell style attributes,
and children calculatedColumnFormula, totalsRowFormula (each with
array, false) and xmlColumnPr (mapId, xpath,
xmlDataType required; denormalized false).
Excel ([MS-OI29500] 2.1.680 to 2.1.684): id from 1 to 4294967294;
a missing or empty name becomes displayName; a totals row
(totalsRowCount 1) needs totalsRowShown true;
ref must have at least headerRowCount + insertRow +
totalsRowCount rows and must not overlap another table or auto filter; with a header
row the column name must equal the header cell’s text; a
totalsRowFunction other than none or custom must match the
cell’s SUBTOTAL(function number, ref) formula; the style attributes of
tableStyleInfo default to false.
Defined names
definedName (18.2.5) in workbook.xml holds the formula or reference as
its text. Attributes: name (required), localSheetId (the 0-based index of
the sheet the name belongs to), hidden, function,
vbProcedure, xlm, publishToServer,
workbookParameter (all false), comment, customMenu,
description, help, statusBar, shortcutKey,
functionGroupId (1 Financial, 2 Date and Time, 3 Math and Trig, 4 Statistical,
5 Lookup and Reference, 6 Database, 7 Text, 8 Logical, 9 Information, 10 Commands,
11 Customizing, 12 Macro Control, 13 DDE / External, 14 User Defined, 15 Engineering, 16 Cube).
Names starting _xlnm. are built in: Print_Area,
Print_Titles, Criteria, _FilterDatabase (the range an
advanced filter or an auto filter was applied to), Extract,
Consolidate_Area, Database, Sheet_Title. A name that is
the whole range A1 to XFD1048576 is an error; any other name overrides a cell reference
that looks the same (LOG10 is always a cell, LOGO1000 can be a name).
Excel ([MS-OI29500] 2.1.568): the text must follow the name-formula grammar;
customMenu, description, help, statusBar,
shortcutKey, xlm, vbProcedure, functionGroupId
and function are reserved and unused; name is 1 to 255 characters and
every name starting _xl is restricted; a name is unique among the names with the same
localSheetId (or among those without one); localSheetId is at most 32766;
xml:space is honoured.
Comments
A comments part (comments, 18.7) holds authors (a list of
author text) and commentList of comment: ref
and authorId (required), guid, shapeId, the rich text
text and an optional commentPr (locked,
defaultSize, print, autoFill, autoLine,
lockText all true; disabled, justLastX,
autoScale false; altText; textHAlign default
left, textVAlign default top; and an anchor).
The box that shows the comment is drawn by a VML part referenced by
legacyDrawing.
Sources
- ECMA-376 5th edition (December 2016) Part 1 text 18.2.5, 18.3.1.10, 18.3.1.11, 18.3.1.32, 18.3.1.47, 18.3.1.55, 18.18.11 to 18.18.21, and Part 4 Transitional
sml.xsd, saved in the project’s research/ooxml/ecma376/ - [MS-OI29500] v20260818, section 2.1 notes on Part 1 chapter 18, research/ooxml/ms/
- LibreOffice
sc/source/filter/oox/worksheetfragment.cxx, Apache POIXSSFDataValidation.java, saved under research/xlsx/programs/