{"id":45,"date":"2026-02-24T08:15:58","date_gmt":"2026-02-24T08:15:58","guid":{"rendered":"https:\/\/gigz.pk\/excel\/?post_type=lesson&#038;p=45"},"modified":"2026-03-07T03:36:05","modified_gmt":"2026-03-07T03:36:05","slug":"if-function","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/excel\/lesson\/if-function\/","title":{"rendered":"IF Function"},"content":{"rendered":"\n<p>The <strong>IF<\/strong> function is one of the most powerful and commonly used functions in Excel. It allows you to make logical decisions based on conditions.<\/p>\n\n\n\n<p>It works like this:<\/p>\n\n\n\n<p>If something is TRUE \u2192 do one thing<br>If something is FALSE \u2192 do another thing<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Structure of IF Function<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">=IF(logical_test, value_if_true, value_if_false)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Explanation:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>logical_test<\/strong> \u2192 The condition to check<\/li>\n\n\n\n<li><strong>value_if_true<\/strong> \u2192 Result if condition is true<\/li>\n\n\n\n<li><strong>value_if_false<\/strong> \u2192 Result if condition is false<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Basic Example<\/h2>\n\n\n\n<p>If marks are in cell A1:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">=IF(A1&gt;=40,\"Pass\",\"Fail\")<\/pre>\n\n\n\n<p>Meaning:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If A1 is 40 or more \u2192 Display &#8220;Pass&#8221;<\/li>\n\n\n\n<li>Otherwise \u2192 Display &#8220;Fail&#8221;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Example with Numbers<\/h2>\n\n\n\n<p>If sales are in A1:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">=IF(A1&gt;1000, \"Bonus\", \"No Bonus\")<\/pre>\n\n\n\n<p>If sales are greater than 1000 \u2192 Bonus<br>Otherwise \u2192 No Bonus<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using IF with Comparison Operators<\/h2>\n\n\n\n<p>You can use:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Greater than<\/li>\n\n\n\n<li>&lt; Less than<\/li>\n\n\n\n<li>= Greater than or equal to<\/li>\n\n\n\n<li>&lt;= Less than or equal to<\/li>\n\n\n\n<li>= Equal to<\/li>\n\n\n\n<li>&lt;&gt; Not equal to<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">IF with Calculations<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">=IF(A1&gt;50, A1*10%, 0)<\/pre>\n\n\n\n<p>If A1 is greater than 50 \u2192 Calculate 10%<br>Otherwise \u2192 Return 0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Nested IF (Multiple Conditions)<\/h2>\n\n\n\n<p>You can combine multiple IF statements.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">=IF(A1&gt;=80,\"A\",<br>   IF(A1&gt;=60,\"B\",<br>      IF(A1&gt;=40,\"C\",\"Fail\")))<\/pre>\n\n\n\n<p>This assigns grades based on marks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Important Tips<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Text values must be in quotation marks (&#8221; &#8220;).<\/li>\n\n\n\n<li>Always check brackets carefully.<\/li>\n\n\n\n<li>Avoid too many nested IFs (use other functions like IFS when available).<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Why IF Function Is Important<\/h2>\n\n\n\n<p>It helps you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Make decisions automatically<\/li>\n\n\n\n<li>Categorize data<\/li>\n\n\n\n<li>Create grading systems<\/li>\n\n\n\n<li>Apply conditions in reports<\/li>\n\n\n\n<li>Build smart spreadsheets<\/li>\n<\/ul>\n\n\n\n<p>The IF function is the foundation of logical calculations in Excel and is essential for every beginner to master.<\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/excel\/\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">Excel Essential Functions (EEF) > Logical Functions > IF Function<\/span><\/span><\/div>\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1772854574696\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n","protected":false},"menu_order":18,"template":"","class_list":["post-45","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>IF Function - Learn Excel the Right Way.<\/title>\n<meta name=\"description\" content=\"Learn how to use the Excel IF function to apply conditions, automate decisions, and create logical formulas with easy examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/excel\/lesson\/if-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IF Function - Learn Excel the Right Way.\" \/>\n<meta property=\"og:description\" content=\"Learn how to use the Excel IF function to apply conditions, automate decisions, and create logical formulas with easy examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/excel\/lesson\/if-function\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Excel the Right Way.\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-07T03:36:05+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/excel\\\/lesson\\\/if-function\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/excel\\\/lesson\\\/if-function\\\/\",\"name\":\"IF Function - Learn Excel the Right Way.\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/excel\\\/#website\"},\"datePublished\":\"2026-02-24T08:15:58+00:00\",\"dateModified\":\"2026-03-07T03:36:05+00:00\",\"description\":\"Learn how to use the Excel IF function to apply conditions, automate decisions, and create logical formulas with easy examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/excel\\\/lesson\\\/if-function\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/excel\\\/lesson\\\/if-function\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/excel\\\/lesson\\\/if-function\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/excel\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel Essential Functions (EEF) > Logical Functions > IF Function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/excel\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/excel\\\/\",\"name\":\"Learn Excel the Right Way.\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/excel\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"IF Function - Learn Excel the Right Way.","description":"Learn how to use the Excel IF function to apply conditions, automate decisions, and create logical formulas with easy examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gigz.pk\/excel\/lesson\/if-function\/","og_locale":"en_US","og_type":"article","og_title":"IF Function - Learn Excel the Right Way.","og_description":"Learn how to use the Excel IF function to apply conditions, automate decisions, and create logical formulas with easy examples.","og_url":"https:\/\/gigz.pk\/excel\/lesson\/if-function\/","og_site_name":"Learn Excel the Right Way.","article_modified_time":"2026-03-07T03:36:05+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/excel\/lesson\/if-function\/","url":"https:\/\/gigz.pk\/excel\/lesson\/if-function\/","name":"IF Function - Learn Excel the Right Way.","isPartOf":{"@id":"https:\/\/gigz.pk\/excel\/#website"},"datePublished":"2026-02-24T08:15:58+00:00","dateModified":"2026-03-07T03:36:05+00:00","description":"Learn how to use the Excel IF function to apply conditions, automate decisions, and create logical formulas with easy examples.","breadcrumb":{"@id":"https:\/\/gigz.pk\/excel\/lesson\/if-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/excel\/lesson\/if-function\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/excel\/lesson\/if-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel Essential Functions (EEF) > Logical Functions > IF Function"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/excel\/#website","url":"https:\/\/gigz.pk\/excel\/","name":"Learn Excel the Right Way.","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/excel\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/excel\/wp-json\/wp\/v2\/lesson\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/excel\/wp-json\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/excel\/wp-json\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/excel\/wp-json\/wp\/v2\/media?parent=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}