Mengkonversi Teks ke Nomor
Defaults settings in Calc converts text inside cells to the respective numeric values if an unambiguous conversion is possible. If no conversion is possible, Calc returns a #VALUE! error.
Only integer numbers including exponent are converted, and ISO 8601 dates and times in their extended formats with separators. Anything else, like fractional numbers with decimal separators or dates other than ISO 8601, is not converted, as the text string would be locale dependent. Leading and trailing blanks are ignored.
Format ISO 8601 berikut ini dikonversi:
-
TTTT-BB-HH
-
CCYY-MM-DDThh:mm:ss,s
-
CCYY-MM-DDThh:mm:ss,s
-
CCYY-MM-DDThh:mm:ss,s
-
CCYY-MM-DDThh:mm:ss.s
-
jj:mm
-
jj:mm:dd
-
jj:mm:dd
-
jj:mm:dd.d
Kode abad CC mungkin tidak dihilangkan. Alih-alih pemisah tanggal dan waktu T, tepat satu karakter spasi dapat digunakan.
Jika tanggal diberikan, itu harus tanggal kalender Gregorian yang benar. Dalam hal ini waktu opsional harus berada dalam kisaran 00:00 hingga 23:59:59,99999...
Jika hanya string waktu yang diberikan, mungkin memiliki nilai jam lebih dari 24, sementara menit dan detik dapat memiliki nilai maksimum 59.
The conversion is done for single scalar values only, not within ranges.
The conversion is done for single scalar values, as in =A1+A2, or ="1E2"+1. Cell range arguments are not affected, so SUM(A1:A2) differs from A1+A2 if at least one of the two cells contain a convertible string.
String di dalam rumus juga dikonversi, seperti dalam ="1999-11-22"+42, yang mengembalikan tanggal 42 hari setelah 22 November 1999. Perhitungan yang melibatkan tanggal yang dilokalisasi sebagai string di dalam rumus mengembalikan kesalahan. Misalnya, string tanggal lokal "11/22/1999" atau "22.11.1999" tidak dapat digunakan untuk konversi otomatis.
Contoh
In A1 enter the text '1e2 (which is converted to the number 100 internally).
In A2 enter =A1+1 (which correctly results in 101).
The formula =SUM(A1:A2), returns 101 instead of 201 because the conversion does not occur in a range, only for single scalar values. Here, '1e2 is treated as string which has value 0 for the SUM function.
=SUM("1E2";1) returns #VALUE! because SUM() and some others that iterate over number sequences explicitly check the argument type.
Changing the default text to number conversion settings
The text to number conversion can be customized in the Detailed Calculation Settings option.