How do I highlight overdue items?
Use a conditional-formatting rule on real due dates. The English formula compares each date with today and skips blank cells.
DataBeginner6 minExcel · Google Sheets
Answer
Put each due date in its own cell, as a real date rather than text. Select those cells, starting at the first date. The formula below is written for D2. Excel and Google Sheets adjust the row number for the other cells in the selection.
The rule highlights a cell when it is not blank and the date is before today. A blank row stays unshaded. TODAY and AND are English function names. A Swedish spreadsheet usually writes IDAG and OCH, and usually separates the two tests with a semicolon: =OCH(D2<>"";D2<IDAG()). That Swedish line is one regional form, not the form for every file. Use the name your spreadsheet offers if it rejects the one you typed.
The invoice template stores issued and due dates as text in YYYY-MM-DD form, and it does not highlight overdue rows. A text date may not compare with TODAY until you convert it to a real date. The template is still a useful list of due dates once those cells are dates.
Steps
1. In Excel
Select the due-date cells. Choose Home, Conditional Formatting, New Rule, then “Use a formula to determine which cells to format.” Enter the formula for the first selected cell, choose a fill color, and apply it.
2. In Google Sheets
Select the due-date cells. Choose Format, then Conditional formatting. Under Format rules, choose “Custom formula is” and enter the formula for the first selected cell. Choose a fill color and click Done.
Highlight D2 when it is a date before today.
English reference form
=AND(D2<>"",D2<TODAY())This spelling uses English function names and commas between arguments. It is the reference form on this site, not the only spelling. A Swedish spreadsheet, for example, uses different function names and usually a semicolon. Cell names such as B2 stay the same.
See function names by languageParts of the formula
=Starts the formula. Conditional formatting in both apps expects the equals sign.
ANDThe English name for “both tests must be true.” Swedish spreadsheets usually write OCH. It is not a universal name.
D2<>""The cell is not empty. The <> operator means “not equal to,” and the quotes are empty text. This keeps blank rows from being highlighted.
D2<TODAY()The date is before today. TODAY is the English function name. Swedish spreadsheets usually write IDAG. TODAY has no arguments, so this pair of parentheses stays empty.
,The comma between the two tests is the English argument separator. Many other locales use a semicolon.