1
1

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.

Google スプレッドシートで日付形式に条件付き書式設定ルールを付けたいとき

Posted at
=A1=datevalue(year(today())&"/"&month(today())&"/1")

A1の部分は条件付き書式の場合、必ず一つずつズレて判定してくれるので、
縦に数値が並んでいる場合、$A1 と、記述しておくのも一つの手。

今回は 2021/04/17 などの、
yyyy/mm/dd 形式で記述してある場合に有効な方法。

DATEVALUE は日付形式に記述している内容を日付としてスプレッドシートに認識させる関数。
なので、TODAY() 関数を使って、まず本日の日付を取得、
YEAR()MONTH() 関数を使い、年の数値と月の数値を取得。

最後に "&" を付けて文字列 "/1" を付ければ、
"yyyy/mm/1" という表記になる。

多くの月表示を作る場合は、
yyyy/mm と入力して、スプレッドシートが自動でyyyy/mm/01と、
変換してしまうはずなので、
この方法なら条件付き書式で当月を判定させることが可能になる。

お困りの方がいたらぜひ。

1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?