Description
Text function mengubah numerik menjadi text dan kita bisa memberi format yang sesuai, fungsi ini berguna waktu kita membuat deskripsi pada LPP atau Surat namun angkanya tetap kita bisa link dengan tabel/angka di worksheet
Untuk menampilkan angka di sel A1 yang berisi 23.5 dengan format dollar kita ketik
=TEXT(A1,"$0.00")
Excel akan menampilkan $23.50 namun dalam bentuk teks sehingga bisa digabung dengan kata/teks lain
Syntax
TEXT(value, format_text)
- value diperlukan, numerik yang akan diubah menjadi teks.
- format_text, diperlukan. berupa text argument jadi harus diapit oleh petikdua (") seperti "m/d/yyyy" atau "#,##0.00"
Guidelines for number formats
Placeholder | Description |
---|---|
0 (zero) | Displays insignificant zeros if a number has fewer digits than there are zeros in the format. For example, if you type 8.9, and you want it to be displayed as 8.90, use the format #.00. |
# | Follows the same rules as the 0 (zero). However, Excel does not display extra zeros when the number that you type has fewer digits on either side of the decimal than there are # symbols in the format. For example, if the custom format is #.##, and you type 8.9 in the cell, the number 8.9 is displayed. |
? | Follows the same rules as the 0 (zero). However, Excel adds a space for insignificant zeros on either side of the decimal point so that decimal points are aligned in the column. For example, the custom format 0.0? aligns the decimal points for the numbers 8.9 and 88.99 in a column. |
. (period) | Displays the decimal point in a number. |
To display | As | Use this format |
---|---|---|
1234.59 | 1234.6 | "####.#" |
8.9 | 8.900 | "#.000" |
0.631 | 0.6 | "0.#" |
12 1234.568 |
12.0 1234.57 |
"#.0#" |
44.398 102.65 2.8 |
44.398 102.65 2.8 (with aligned decimals) |
"???.???" |
5.25 5.3 |
5 1/4 5 3/10 (with aligned fractions) |
"# ???/???" |
- Display a thousands separator To display a comma as a thousands separator or to scale a number by a multiple of 1,000, include the following separator in the number format.
, (comma) | Displays the thousands separator in a number. Excel separates thousands by commas if the format contains a comma that is enclosed by number signs (#) or by zeros. A comma that follows a digit placeholder scales the number by 1,000. For example, if the format_text argument is "#,###.0,", Excel displays the number 12,200,000 as 12,200.0. |
To display | As | Use this format |
---|---|---|
12000 | 12,000 | "#,###" |
12000 | 12 | "#," |
12200000 | 12.2 | "0.0,," |
Guidelines for date and time formats
- Display days, months, and years To display numbers as date formats (such as days, months, and years), use the following codes in the format_text argument.
m | Displays the month as a number without a leading zero. |
---|---|
mm | Displays the month as a number with a leading zero when appropriate. |
mmm | Displays the month as an abbreviation (Jan to Dec). |
mmmm | Displays the month as a full name (January to December). |
mmmmm | Displays the month as a single letter (J to D). |
d | Displays the day as a number without a leading zero. |
dd | Displays the day as a number with a leading zero when appropriate. |
ddd | Displays the day as an abbreviation (Sun to Sat). |
dddd | Displays the day as a full name (Sunday to Saturday). |
yy | Displays the year as a two-digit number. |
yyyy | Displays the year as a four-digit number. |
To display | As | Use this format |
---|---|---|
Months | 1–12 | "m" |
Months | 01–12 | "mm" |
Months | Jan–Dec | "mmm" |
Months | January–December | "mmmm" |
Months | J–D | "mmmmm" |
Days | 1–31 | "d" |
Days | 01–31 | "dd" |
Days | Sun–Sat | "ddd" |
Days | Sunday–Saturday | "dddd" |
Years | 00–99 | "yy" |
Years | 1900–9999 | "yyyy" |
- Display hours, minutes, and seconds To display time formats (such as hours, minutes, and seconds), use the following codes in the format_text argument.
h | Displays the hour as a number without a leading zero. |
---|---|
[h] | Displays elapsed time in hours. If you are working with a formula that returns a time in which the number of hours exceeds 24, use a number format that resembles [h]:mm:ss. |
hh | Displays the hour as a number with a leading zero when appropriate. If the format contains AM or PM, the hour is shown based on the 12-hour clock. Otherwise, the hour is shown based on the 24-hour clock. |
m | Displays the minute as a number without a leading zero. Note The m or the mm code must appear immediately after the h or hh code or immediately before the ss code; otherwise, Excel displays the month instead of minutes. |
[m] | Displays elapsed time in minutes. If you are working with a formula that returns a time in which the number of minutes exceeds 60, use a number format that resembles [mm]:ss. |
mm | Displays the minute as a number with a leading zero when appropriate. Note The m or the mm code must appear immediately after the h or hh code or immediately before the ss code; otherwise, Excel displays the month instead of minutes. |
s | Displays the second as a number without a leading zero. |
[s] | Displays elapsed time in seconds. If you are working with a formula that returns a time in which the number of seconds exceeds 60, use a number format that resembles [ss]. |
ss | Displays the second as a number with a leading zero when appropriate. If you want to display fractions of a second, use a number format that resembles h:mm:ss.00. |
AM/PM, am/pm, A/P, a/p | Displays the hour based on a 12-hour clock. Excel displays AM, am, A, or a for times from midnight until noon and PM, pm, P, or p for times from noon until midnight. |
To display | As | Use this format |
---|---|---|
Hours | 0–23 | "h" |
Hours | 00–23 | "hh" |
Minutes | 0–59 | "m" |
Minutes | 00–59 | "mm" |
Seconds | 0–59 | "s" |
Seconds | 00–59 | "ss" |
Time | 4 AM | "h AM/PM" |
Time | 4:36 PM | "h:mm AM/PM" |
Time | 4:36:03 P | "h:mm:ss A/P" |
Time | 4:36:03.75 | "h:mm:ss.00" |
Elapsed time (hours and minutes) | 1:02 | "[h]:mm" |
Elapsed time (minutes and seconds) | 62:16 | "[mm]:ss" |
Elapsed time (seconds and hundredths) | 3735.80 | "[ss].00" |
Kalau pusing lihat penjelasan diatas (maklum copas dari excel help) pake cara gampang aja
Sumber : http://microsoft-studios.com/2012/03/text-function/