IF in ExcelUse IF and END-IF to show or hide rows in Excel templates based on a condition.Sep 25, 2025Knowledge
InformationArticle BodyExamples Use Case 1: Display overdue invoices Display an "Overdue" row when an invoice is overdue. Example data: { "Account": { "Name": "ACME Inc.", "Invoices": [ { "Name": "Invoice #1001", "Amount": 5000,  "DueDate": "2025-08-15", "IsOverdue": false }, { "Name": "Invoice #1002", "Amount": 7500,  "DueDate": "2025-09-05", "IsOverdue": true }, { "Name": "Invoice #1003", "Amount": 12000, "DueDate": "2025-08-20", "IsOverdue": true }, { "Name": "Invoice #1004", "Amount": 3000,  "DueDate": "2025-10-01", "IsOverdue": false } ] }} Template Document: Output: Use Case 2: Hide table when list is empty Show a "There are no line items." row only when an item list is empty. Example data: { "Opportunity": { "Id": "006XXXXXXXXXXXXAAB", "Name": "Opportunity Without Items", "StageName": "Prospecting", "Amount": 50, "CloseDate": "2025-10-15", "OpportunityLineItems": [] }} Template Document: Output: Notes IF and END-IF can be used to conditionally show text within a single cell. Next Steps About IF IF in Word IF in PowerPoint TitleIF in ExcelURL NameIF-in-Excel