1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【スプレッドシート】日付から月だけ取得する関数

Posted at

TEXT関数でOK

TEXT関数を使います。
第一引数に対象の日付を指定し、第二引数に表示形式を指定します。

ゼロパディング無しの月を取得したい

=TEXT(A1,"m")でゼロパディング無しの月を取得できます。
image.png

ゼロパディング有りの月を取得したい

=TEXT(A1,"mm")でゼロパディング有りの月を取得できます。
image.png

他にも様々な表示形式がある

以下の表示形式がサポートされています。

https://support.google.com/docs/answer/3094139?hl=ja

  • TEXT 関数は、次の日付/時刻形式をサポートしています。
    • d - 1 桁または 2 桁の日付。
    • dd - 2 桁の日付。
    • ddd - 曜日の省略名。
    • dddd - 曜日の正式名。
    • m - 1 桁か 2 桁の月名、または時刻の分。時刻の時と秒とともにこのコードを指定していない場合は、月名が使用されます。
    • mm - 2 桁の月名、または時刻の分。時刻の時と秒とともにこのコードを指定していない場合は、月名が使用されます。
    • mmm - 月の省略名。
    • mmmm - 月の正式名。
    • mmmmm - 月名の最初の文字。
    • YY - 2 桁の年。
    • yyyy - 4 桁の年。
    • HH - 24 時間制の時。
    • hh - 12 時間制の時。
    • ss - 時刻の秒。
    • ss.000 - 時刻のミリ秒。
    • AM/PM - 12 時間制の時間表示で、時刻に基づいて AM(午前)、PM(午後)を表示します。

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?