Skip to contents

xlsx_formats() imports formatting definitions from spreadsheets. The structure is a nested list, e.g. bold is a vector within the list font, which is within the list local, which is within the list returned by xlsx_formats(). You can look up a cell's formatting by indexing the bottom-level vectors. See 'Details' for examples.

Usage

xlsx_formats(path, check_filetype = TRUE)

Arguments

path

Path to the xlsx file.

check_filetype

Logical. Whether to check that the filetype is xlsx (or xlsm) by looking at the file itself, rather than using the filename extension.

Value

A nested list of vectors, beginning at the top level with $style and $local, then drilling down to the vectors that hold the definitions. E.g. my_formats$local$font$size.

Details

There are two types of formatting: 'style' formatting, such as Excel's built-in styles 'normal', 'bad', etc., and 'local' formatting, which overrides the style. These are returned in the $style and $local sublists of xlsx_formats(), with identical structures.

To look up the local formatting of a given cell, take the cell's local_format_id value (my_cells$Sheet1[1, "local_format_id"]), and use it as an index into the format structure. E.g. to look up the font size, my_formats$local$font$size[local_format_id]. To see all available formats, type str(my_formats$local).

Colours may be recorded in any of three ways: a hexadecimal RGB string with or without alpha, an 'indexed' colour, and an index into a 'theme'. xlsx_formats() dereferences 'indexed' and 'theme' colours to their hexadecimal RGB string representation, and standardises all RGB strings to have an alpha channel in the first two characters. The 'index' and the 'theme' name are still provided. To filter by an RGB string, you could look up the RGB values in a spreadsheet program (e.g. Excel, LibreOffice, Gnumeric), and use the grDevices::rgb() function to convert these to a hexadecimal string.

A <- 1; R <- 0.5; G <- 0; B <- 0
rgb(A, R, G, B)
# [1] "#FF800000"

Examples

examples <- system.file("extdata/examples.xlsx", package = "tidyxl")
str(xlsx_formats(examples))
#> List of 2
#>  $ local:List of 6
#>   ..$ numFmt    : chr [1:173] "General" "d-mmm-yy" "[$-1409]d mmmm yyyy;@" "yyyy mmmm dddd" ...
#>   ..$ font      :List of 10
#>   .. ..$ bold     : logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. ..$ italic   : logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. ..$ underline: chr [1:173] NA NA NA NA ...
#>   .. ..$ strike   : logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. ..$ vertAlign: chr [1:173] NA NA NA NA ...
#>   .. ..$ size     : num [1:173] 11 11 11 11 11 11 11 11 11 11 ...
#>   .. ..$ color    :List of 4
#>   .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. ..$ name     : chr [1:173] "Arial" "Arial" "Arial" "Arial" ...
#>   .. ..$ family   : int [1:173] 2 2 2 2 2 2 2 2 2 2 ...
#>   .. ..$ scheme   : chr [1:173] NA NA NA NA ...
#>   ..$ fill      :List of 2
#>   .. ..$ patternFill :List of 3
#>   .. .. ..$ fgColor    :List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. ..$ bgColor    :List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. ..$ patternType: chr [1:173] NA NA NA NA ...
#>   .. ..$ gradientFill:List of 8
#>   .. .. ..$ type  : chr [1:173] NA NA NA NA ...
#>   .. .. ..$ degree: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. ..$ left  : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. ..$ right : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. ..$ top   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. ..$ bottom: num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. ..$ stop1 :List of 2
#>   .. .. .. ..$ position: num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ color   :List of 4
#>   .. .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. ..$ stop2 :List of 2
#>   .. .. .. ..$ position: num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ color   :List of 4
#>   .. .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   ..$ border    :List of 12
#>   .. ..$ diagonalDown: logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. ..$ diagonalUp  : logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. ..$ outline     : logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. ..$ left        :List of 2
#>   .. .. ..$ style: chr [1:173] NA NA NA NA ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. ..$ right       :List of 2
#>   .. .. ..$ style: chr [1:173] NA NA NA NA ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. ..$ start       :List of 2
#>   .. .. ..$ style: chr [1:173] NA NA NA NA ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. ..$ end         :List of 2
#>   .. .. ..$ style: chr [1:173] NA NA NA NA ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. ..$ top         :List of 2
#>   .. .. ..$ style: chr [1:173] NA NA NA NA ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. ..$ bottom      :List of 2
#>   .. .. ..$ style: chr [1:173] NA NA NA NA ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. ..$ diagonal    :List of 2
#>   .. .. ..$ style: chr [1:173] NA NA NA NA ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. ..$ vertical    :List of 2
#>   .. .. ..$ style: chr [1:173] NA NA NA NA ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. ..$ horizontal  :List of 2
#>   .. .. ..$ style: chr [1:173] NA NA NA NA ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ theme  : chr [1:173] NA NA NA NA ...
#>   .. .. .. ..$ indexed: int [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   .. .. .. ..$ tint   : num [1:173] NA NA NA NA NA NA NA NA NA NA ...
#>   ..$ alignment :List of 8
#>   .. ..$ horizontal     : chr [1:173] "general" "general" "general" "general" ...
#>   .. ..$ vertical       : chr [1:173] "bottom" "bottom" "bottom" "bottom" ...
#>   .. ..$ wrapText       : logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. ..$ readingOrder   : chr [1:173] "context" "context" "context" "context" ...
#>   .. ..$ indent         : int [1:173] 0 0 0 0 0 0 0 0 0 1 ...
#>   .. ..$ justifyLastLine: logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. ..$ shrinkToFit    : logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. ..$ textRotation   : int [1:173] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ protection:List of 2
#>   .. ..$ locked: logi [1:173] TRUE TRUE TRUE TRUE TRUE TRUE ...
#>   .. ..$ hidden: logi [1:173] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>  $ style:List of 6
#>   ..$ numFmt    : Named chr [1:6] "General" "General" "yyyy-mm-dd hh:mm:ss" "0%" ...
#>   .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   ..$ font      :List of 10
#>   .. ..$ bold     : Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ italic   : Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ underline: Named chr [1:6] NA NA NA NA ...
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ strike   : Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ vertAlign: Named chr [1:6] NA NA NA NA ...
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ size     : Named num [1:6] 11 11 11 11 11 11
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ color    :List of 4
#>   .. .. ..$ rgb    : Named chr [1:6] NA "FF9C0006" "FF000000" NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ theme  : Named chr [1:6] NA NA "text1" NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ name     : Named chr [1:6] "Arial" "Calibri" "Calibri" "Arial" ...
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ family   : Named int [1:6] 2 2 2 2 2 2
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ scheme   : Named chr [1:6] NA "minor" "minor" NA ...
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   ..$ fill      :List of 2
#>   .. ..$ patternFill :List of 3
#>   .. .. ..$ fgColor    :List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA "FFFFC7CE" NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ bgColor    :List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ patternType: Named chr [1:6] NA "solid" NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ gradientFill:List of 8
#>   .. .. ..$ type  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ degree: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ left  : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ right : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ top   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ bottom: Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ stop1 :List of 2
#>   .. .. .. ..$ position: Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ color   :List of 4
#>   .. .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ stop2 :List of 2
#>   .. .. .. ..$ position: Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ color   :List of 4
#>   .. .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   ..$ border    :List of 12
#>   .. ..$ diagonalDown: Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ diagonalUp  : Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ outline     : Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ left        :List of 2
#>   .. .. ..$ style: Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ right       :List of 2
#>   .. .. ..$ style: Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ start       :List of 2
#>   .. .. ..$ style: Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ end         :List of 2
#>   .. .. ..$ style: Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ top         :List of 2
#>   .. .. ..$ style: Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ bottom      :List of 2
#>   .. .. ..$ style: Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ diagonal    :List of 2
#>   .. .. ..$ style: Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ vertical    :List of 2
#>   .. .. ..$ style: Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ horizontal  :List of 2
#>   .. .. ..$ style: Named chr [1:6] NA NA NA NA ...
#>   .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. ..$ color:List of 4
#>   .. .. .. ..$ rgb    : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ theme  : Named chr [1:6] NA NA NA NA ...
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ indexed: Named int [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. .. .. ..$ tint   : Named num [1:6] NA NA NA NA NA NA
#>   .. .. .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   ..$ alignment :List of 8
#>   .. ..$ horizontal     : Named chr [1:6] "general" "general" "center" "general" ...
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ vertical       : Named chr [1:6] "bottom" "bottom" "bottom" "bottom" ...
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ wrapText       : Named logi [1:6] FALSE FALSE TRUE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ readingOrder   : Named chr [1:6] "context" "context" "left-to-right" "context" ...
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ indent         : Named int [1:6] 0 0 0 0 0 0
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ justifyLastLine: Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ shrinkToFit    : Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ textRotation   : Named int [1:6] 0 0 0 0 0 0
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   ..$ protection:List of 2
#>   .. ..$ locked: Named logi [1:6] TRUE TRUE FALSE TRUE TRUE TRUE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...
#>   .. ..$ hidden: Named logi [1:6] FALSE FALSE FALSE FALSE FALSE FALSE
#>   .. .. ..- attr(*, "names")= chr [1:6] "Normal" "Bad" "styledate" "Percent" ...

# The formats of particular cells can be retrieved like this:

cells <- xlsx_cells(examples)
formats <- xlsx_formats(examples)

formats$local$font$bold[cells$local_format_id]
#>   [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#>  [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#>  [25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#>  [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#>  [49] FALSE FALSE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE
#>  [61] FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#>  [73] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#>  [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE
#>  [97] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [109] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [121] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [133] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [145] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [157] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [169] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [181] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [193] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [205] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [217] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [229] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [241] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [253] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [265] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [277] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [289] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [301] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [313] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [325] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [337] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [349] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [361] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [373] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [385] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [397] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [409] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [421] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [433] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [445] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [457] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [469] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [481] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [493] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [505] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [517] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [529] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [541] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [553] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [565] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
#> [577] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
formats$style$font$bold[cells$style_format]
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal   Percent    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal       Bad    Normal       Bad    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#> styledate    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal styledate    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal  Normal 2    Normal  Normal 2 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>  Normal 2  Normal 2  Normal 2  Normal 2  Normal 2  Normal 2  Normal 2    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>  Normal 2    Normal  Normal 2    Normal  Normal 2    Normal  Normal 2    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>  Normal 2    Normal  Normal 2    Normal  Normal 2    Normal  Normal 2    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>  Normal 2 Hyperlink  Normal 2 Hyperlink  Normal 2    Normal  Normal 2    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal  Normal 2    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal    Normal    Normal    Normal    Normal    Normal    Normal 
#>     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE     FALSE 
#>    Normal    Normal 
#>     FALSE     FALSE 

# To filter for cells of a particular format, first filter the formats to get
# the relevant indices, and then filter the cells by those indices.
bold_indices <- which(formats$local$font$bold)
cells[cells$local_format_id %in% bold_indices, ]
#> # A tibble: 3 × 24
#>   sheet  address   row   col is_blank content data_type error logical numeric
#>   <chr>  <chr>   <int> <int> <lgl>    <chr>   <chr>     <chr> <lgl>     <dbl>
#> 1 Sheet1 A28        28     1 FALSE    0       character NA    NA           NA
#> 2 Sheet1 A32        32     1 FALSE    6       character NA    NA           NA
#> 3 Sheet1 A49        49     1 FALSE    12      character NA    NA           NA
#> # ℹ 14 more variables: date <dttm>, character <chr>,
#> #   character_formatted <list>, formula <chr>, is_array <lgl>,
#> #   formula_ref <chr>, formula_group <int>, comment <chr>, height <dbl>,
#> #   width <dbl>, row_outline_level <dbl>, col_outline_level <dbl>,
#> #   style_format <chr>, local_format_id <int>