Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What data types does Google Sheets support?

I haven't been able to find an answer online for this or in the Sheets documentation. What data types does a single cell in Google Sheets support?

For example here is what I've seen so far:

enter image description here

Is there a list of acceptable data types that Google Sheets accepts?

like image 752
David542 Avatar asked Jun 13 '17 23:06

David542


2 Answers

Like you I was unable to find a definitive list of datatypes. However, through personal experience and testing, I verified that Google sheets supports the following data types:

  • Decimal (up to 15 digits, scale from +308 to -308, also used to represent integers)
  • Double precision floating point numbers
  • String (max length: 50,000 characters)
  • Boolean (TRUE and FALSE)
  • Error code (e.g. #N/A, #DIV/0!, and #REF!)

Note: Dates, Times, and Datetimes are stored as Decimals.

Arrays can also be used in Google Sheets. Arrays behave similar to the way they do in Excel, but Sheets does not restrict the user from editing cells in an array the way that Excel does.

Note on Decimals vs Double: It's important to note: Decimals are just 15-digit integers that can have a decimal point in one of 617 positions; the underlying data structure uses integers. On the other hand, a Double follows the definition of the IEEE 754 double-precision floating point numbers, which are prone to losing precision during calculations.

like image 107
Austin Avatar answered Sep 21 '22 16:09

Austin


According to the Google Sheets API v4 (ref) the cell values could be (emphasis mine):

ExtendedValue

The kinds of value that a cell in a spreadsheet can have.

  • numberValue number

    Represents a double value. Note: Dates, Times and DateTimes are represented as doubles in "serial number" format.

  • stringValue string

    Represents a string value. Leading single quotes are not included. For example, if the user typed '123 into the UI, this would be represented as a stringValue of "123" .

  • boolValue boolean

    Represents a boolean value.

  • formulaValue string

    Represents a formula.

  • errorValue object( ErrorValue )

    Represents an error. This field is read-only.

like image 36
Rubén Avatar answered Sep 18 '22 16:09

Rubén