メインコンテンツへスキップ

Excelで日付に基づいて条件付き書式を設定するにはどうすればよいですか?

すでに知っているように、条件付き書式はセルの内容に基づいてセル形式を自動変更できます。 このチュートリアルでは、Excelで日付に基づいてセルを条件付きで書式設定する方法を紹介します。

TODAY以上/古い条件付きフォーマット日付

過去の日付の条件付き書式

条件付き書式の将来の日付

XNUMXつの日付間の条件付き書式

別の列の日付に基づく条件付き書式


TODAY以上/古い条件付きフォーマット日付

日付を条件付きでフォーマットするには、新しいルールを作成する必要があります。

1.条件付き書式を追加するセルを選択し、をクリックします ホーム > 条件付き書式 > 新しいルール.
doc条件付き書式設定日付1

2。 の中に 新しい書式設定規則 ダイアログ、選択 式を使用して、フォーマットするセルを決定する in ルールタイプを選択します セクションで、入力する必要がある数式をXNUMXつ選択します この数式が真であるときの書式値 テキストボックス。

  • 今日と同じ:=$B2=TODAY()
  • 今日よりもリッター: =$B2>TODAY()
  • 今日より古い: =$B2<TODAY()

doc条件付き書式設定日付2

3。 クリック フォーマット を選択して セルの書式設定 ダイアログで、必要に応じてセルを強調表示する形式をXNUMXつ選択します。
doc条件付き書式設定日付3

4。 クリック OK > OK。 日付はフォーマットされています。

Note:今日は15年8月2018日です
doc条件付き書式設定日付4


過去の日付の条件付き書式

過去の日付を条件付きで書式設定する場合は、[新しい書式設定ルール]ダイアログで次のように実行できます。

1.必要に応じて以下の数式のいずれかを選択し、 この数式が真であるときの書式値 テキストボックス。

  • 30日以上前: =TODAY()-$B2>30
  • 30〜15日前まで。 =AND(TODAY()-$B2>=15, TODAY()-$B2<=30)
  • 15日未満: =AND(TODAY()-$B2>=1, TODAY()-$B2<15)

2。 次に、をクリックします フォーマット でXNUMXつの形式を選択するには セルの書式設定 ダイアログ。

3。 クリック OK > OK ダイアログを閉じます。

Note:今日は15年8月2018日です
doc条件付き書式設定日付5


条件付き書式の将来の日付

将来の日付を条件付きでフォーマットするには、次のようにします。

1.必要に応じて以下の数式のいずれかを選択し、 この数式が真であるときの書式値 テキストボックス。

  • 今から30日以上後に発生します: =$B2-TODAY()>30
  • 30〜15日で: =AND($B2-TODAY()>=15, $B2-TODAY()<=30)
  • 15日以内: =AND($B2-TODAY()>=1, $B2-TODAY()<15)

2。 次に、をクリックします フォーマット でXNUMXつの形式を選択するには セルの書式設定 ダイアログ。

3。 クリック OK > OK ダイアログを閉じます。


XNUMXつの日付間の条件付き書式

XNUMXつの日付間の条件付き書式を設定するには、セルを選択してこの数式を使用します。 =AND($B2>=$D$2,$B2<=$E$2) D2は開始日、E2は終了日です。 次に、必要な形式でセルをフォーマットします。

doc条件付き書式設定日付6
doc条件付き書式設定日付7

別の列の日付に基づく条件付き書式

別の列の日付に基づいてセルを条件付きで書式設定する場合は、次のようにすることができます。

1.列Bの相対日付が16年8月2018日であるときに、列Cの売上を強調表示する場合は、最初に列Cの範囲を選択してください。

2. [新しい書式設定ルール]ダイアログを有効にして、この式を入力します =$B2=DATEVALUE("8/16/2018") この数式が真であるときの書式値 テキストボックスで、セルをフォーマットします セルの書式設定 ダイアログ。

doc条件付き書式設定日付8
doc条件付き書式設定日付9

注: 上記の数式では、B2は選択した日付範囲の最初の日付セルです。


最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How can I automatically add a date when a cell contains certain text? So, for example, if cell A1 contains "to do", a date is automatically added in another cell. This date is based on a date also from a cell and I would like to add a date + 65 days in the future. Is this possible?
This comment was minimized by the moderator on the site
Cześć, mierzę się z problemem warunkowego podświetlania daty, np.: w kolumnie A mam datę startu danej czynności np. 01.01.2023, w kolumnie B mam datę końca danej czynności np. 07.01.2023 i chodziłoby mi o to, żeby wyróżnić warunkowo np. kolorem zielonym datę w kolumnie B jeżeli pomiędzy datą startu, a datą końca czynności upłynęło mniej niż 7 dni, jeżeli 7 dni i więcej kolorem czerwonym.
This comment was minimized by the moderator on the site
Use two formulas in the conditional formatting dialog:
difference between start date and end date is greater than or equal to 7 days: =B2-A2>=7 format to red
difference between start date and end date is smaller than 7 days: =B2-A2<7 format to green
see screenshot:
https://cdn.extendoffice.com/images/stories/comments/sun-comment/doc-difference-greater-than-7.png
This comment was minimized by the moderator on the site
Cześć, mierzę się z problemem warunkowego podświetlania daty, np.: w kolumnie A mam datę startu danej czynności np. 01.01.2023, w kolumnie B mam datę końca danej czynności np. 07.01.2023 i chodziłoby mi o to, żeby wyróżnić warunkowo np. kolorem zielonym datę w kolumnie B jeżeli pomiędzy datą startu, a datą końca czynności upłynęło mniej niż 7 dni, jeżeli 7 dni i więcej kolorem czerwonym.
This comment was minimized by the moderator on the site
Cześć, mierzę się z problemem warunkowego podświetlania daty, np.: w kolumnie A mam datę startu danej czynności np. 01.01.2023, w kolumnie B mam datę końca danej czynności np. 07.01.2023 i chodziłoby mi o to, żeby wyróżnić warunkowo np. kolorem zielonym datę w kolumnie B jeżeli pomiędzy datą startu, a datą końca czynności upłynęło mniej niż 7 dni, jeżeli 7 dni i więcej kolorem czerwonym.
This comment was minimized by the moderator on the site
Ciao, come posso utilizzare il conditional formatting per evidenziare il mese corrente e il mese successivo?
This comment was minimized by the moderator on the site
Hi, Michela,
highlight the date in current month, please use formula =TEXT(TODAY(),"m")-TEXT(A1,"m")=0 in conditional formatting new rule dialog, and select a color such as yellow to outstanding the dates.
highlight the date in next month, use formula =TEXT(A1,"m")-TEXT(TODAY(),"m")=1 in conditional formatting new rule dialog, and select a color such as green to outstanding the dates.
see screenshot:
https://cdn.extendoffice.com/images/stories/comments/sun-comment/doc-highlight-current-month.png
This comment was minimized by the moderator on the site
Hello there! I have been searching everywhere for an answer to my problem. I really hope that you can help. I have a column of dates that have taken place in the past. It was when a medical fit test was performed. Those need to be done every two years. What I would like to do is have the dates highlight the box Yellow when they are within being 30 days due, and then Red as soon as they are past due. (So if the date in the box is 1/1/2021, it would turn yellow on 12/1/22. It would then turn red on 1/2/23) These dates are a column in a database so I can't just put a date in a cell to be the reference in the formula. I can only use the cell with the date itself. My brain has melted trying to figure this out, please help. I've gone in Excel formula circles and keep coming up with nothing.

I also have a second column that I need to do the same thing with where it happens on a yearly basis.

Any help will be appreciated. Thank you
This comment was minimized by the moderator on the site
Hi, Kris, create two rules in the conditional formatting dialog:
=AND(0<DATE(YEAR($A1)+2,MONTH($A1),DAY($A1))-TODAY(),DATE(YEAR($A1)+2,MONTH($A1),DAY($A1))-TODAY()<=30) using this formula and choose yellow filled color to mark the within 30 days due
=(DATE(YEAR(A1)+2,MONTH(A1),DAY(A1))<TODAY()) using this formula and choose red filled color to mark the past due
This comment was minimized by the moderator on the site
Hola!

como puedo hacer una formula para que si columna D es igual a la comuna E sea verdadero, pero si columna A + 90 dias es igual al columna E siga siendo verdadero de lo contrario sea falso, gracias.
This comment was minimized by the moderator on the site
Hi, try this formula:=IFERROR(IFS(E2=D2,"TRUE",E2=A2+90,"TRUE"),"""FALSE")
Notice that if you are not in other lagnuage version, maybe you need to transform the formula to your local language.
This comment was minimized by the moderator on the site
ERP PO No. Region Update-1 Supplier PIC Note To Receiver PO Age
1091BPA6438143-121 Bali - Lombok Not Yet Implement PS2MS XL 31
1091BPA6438143-123 Bali - Lombok Not Yet Implement Lumpsum 31
1091BPA6438143-124 Bali - Lombok Not Yet Implement Service Package 31
1091BPA6438143-125 Bali - Lombok Not Yet Implement Battery Maintenance 31
1091BPA6438143-127 Bali - Lombok Not Yet Implement MS Dismantle Board 22

kalau cara conditional formating untuk PO aging Lebih dari 70 gimana ya, tapi di file pivot, karena database saya untuk po aging 70 itu pake rumus =IFERROR(DATEDIF(NOW();B56;"d");""&DATEDIF(B56;NOW();"d")) jadi saat saya conditional formating aging lebih dari 70 dengan warna merah itu tidak ke detack di pivotnya,
mohon bantuannya😁
This comment was minimized by the moderator on the site
Bonjour,
je cherche dans GOOGLE SHEET à faire une mise en forme conditionnelle par rapport à une date; je cherche à faire en sorte que quand la date inscrite dans une case dépasse 15jrs alors elle devienne rouge. (01/08/22 dans la case, quand nous sommes le 16/08/22 je voudrais que la case devienne rouge)

merci d'avance.
This comment was minimized by the moderator on the site
Hi, vex, sorry that I only can reply with English since I do not know French. Supposing you want to format all dates that over 15 days based on a date 7/21/2022, you may firstly, change the date 7/21/2022 to a number, 44763, then select the dates that you want to highlight, click Format > Conditional Formatting, and choose Custom formula is in the Format Rules section, type B2>44763+15, and choose red color. See the screenshot:
https://www.extendoffice.com/images/stories/comments/sun-comment/doc_google_sheet_conditional_formatting.png
Hope can help you.
This comment was minimized by the moderator on the site
Bonjour, j'ai téléchargé un document excel pour la gestion des congés: Shift staff. Je voudrais que certaines dates soient conditionnées pour rester inactives chaque année (il s'agit des congés légaux comme le 1er janvier ou le 15 aout) - actuellement je ne peux conditonner que les jours de la semaine, pas les dates - pouvez-vous m'aider?

Merci beaucoup

Pascale
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations