{"id":4021,"date":"2026-11-23T22:19:52","date_gmt":"2026-11-23T16:49:52","guid":{"rendered":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel"},"modified":"2026-11-23T23:21:18","modified_gmt":"2026-11-23T17:51:18","slug":"if-formula-in-excel","status":"publish","type":"post","link":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel","title":{"rendered":"IF Formula in Excel, With Nested IF, IFS, AND and OR"},"content":{"rendered":"<p>The IF formula in Excel returns one value when a test is true and another when it is false: =IF(B2&gt;=C2, &#8220;Met&#8221;, &#8220;Missed&#8221;) shows Met when sales in B2 reach the target in C2, and Missed when they do not. For more than two outcomes, put another IF in the false slot (a nested IF), or use IFS, which lists the conditions in order and needs Excel 2019 or later.<\/p>\n<p>That is the whole idea. The rest of this lesson is the part that goes wrong in practice: conditions in the wrong order, numbers written as text, percentages compared against whole numbers, and nested formulas nobody can read a month later.<\/p>\n<h2>IF syntax<\/h2>\n<p>IF takes three arguments. Only the first is required, but leaving out the third causes problems, as shown further down.<\/p>\n<table>\n<thead>\n<tr>\n<th>Argument<\/th>\n<th>What it means<\/th>\n<th>Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>logical_test<\/td>\n<td>Anything that is either TRUE or FALSE<\/td>\n<td>B2&gt;=C2<\/td>\n<\/tr>\n<tr>\n<td>value_if_true<\/td>\n<td>What to return when the test is TRUE<\/td>\n<td>&#8220;Met&#8221;<\/td>\n<\/tr>\n<tr>\n<td>value_if_false<\/td>\n<td>What to return when the test is FALSE<\/td>\n<td>&#8220;Missed&#8221;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The test almost always uses one of six comparison operators. Text in a test or a result goes in double quotes; numbers and cell references do not.<\/p>\n<table>\n<thead>\n<tr>\n<th>Operator<\/th>\n<th>Meaning<\/th>\n<th>Example test<\/th>\n<th>TRUE when<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>=<\/td>\n<td>Equal to<\/td>\n<td>E2=0<\/td>\n<td>E2 holds 0<\/td>\n<\/tr>\n<tr>\n<td>&lt;&gt;<\/td>\n<td>Not equal to<\/td>\n<td>F2&lt;&gt;&#8221;Closed&#8221;<\/td>\n<td>F2 is anything other than Closed<\/td>\n<\/tr>\n<tr>\n<td>&gt;<\/td>\n<td>Greater than<\/td>\n<td>B2&gt;500000<\/td>\n<td>B2 is above 5 lakh<\/td>\n<\/tr>\n<tr>\n<td>&lt;<\/td>\n<td>Less than<\/td>\n<td>B2&lt;C2<\/td>\n<td>Sales are below target<\/td>\n<\/tr>\n<tr>\n<td>&gt;=<\/td>\n<td>Greater than or equal to<\/td>\n<td>B2&gt;=C2<\/td>\n<td>Sales meet or beat target<\/td>\n<\/tr>\n<tr>\n<td>&lt;=<\/td>\n<td>Less than or equal to<\/td>\n<td>E2&lt;=2<\/td>\n<td>Two or fewer overdue invoices<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>The data used throughout<\/h2>\n<p>A textile distributor in Ahmedabad pays its five sales reps an incentive based on how they did against their monthly target. The sheet has sales and target in rupees, achievement in column D as =B2\/C2 <a href=\"https:\/\/www.skillovilla.com\/blogs\/percentage-formula-in-excel\">formatted as a percentage<\/a>, and the number of unpaid invoices each rep&#8217;s customers have run up past their due date.<\/p>\n<table>\n<thead>\n<tr>\n<th>A: Rep<\/th>\n<th>B: Sales<\/th>\n<th>C: Target<\/th>\n<th>D: Achievement<\/th>\n<th>E: Overdue invoices<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hetal<\/td>\n<td>540000<\/td>\n<td>500000<\/td>\n<td>108%<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>Jignesh<\/td>\n<td>410000<\/td>\n<td>450000<\/td>\n<td>91.1%<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>Mitesh<\/td>\n<td>735000<\/td>\n<td>600000<\/td>\n<td>122.5%<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>Pooja<\/td>\n<td>300000<\/td>\n<td>450000<\/td>\n<td>66.7%<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>Rakesh<\/td>\n<td>450000<\/td>\n<td>450000<\/td>\n<td>100%<\/td>\n<td>0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>A simple IF: two outcomes<\/h2>\n<p>The first question is just whether each rep hit target. The formula goes in F2 and is copied down.<\/p>\n<table>\n<thead>\n<tr>\n<th>Rep<\/th>\n<th>=IF(B2&gt;=C2, &#8220;Met&#8221;, &#8220;Missed&#8221;)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hetal<\/td>\n<td>Met<\/td>\n<\/tr>\n<tr>\n<td>Jignesh<\/td>\n<td>Missed<\/td>\n<\/tr>\n<tr>\n<td>Mitesh<\/td>\n<td>Met<\/td>\n<\/tr>\n<tr>\n<td>Pooja<\/td>\n<td>Missed<\/td>\n<\/tr>\n<tr>\n<td>Rakesh<\/td>\n<td>Met<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Rakesh shows Met because &gt;= includes equality. With &gt; alone, a rep who hit target exactly would be marked Missed, which is the sort of error that gets noticed on payday.<\/p>\n<p>IF can return a calculation as easily as a label. Here, reps who meet target earn 2% of sales and the rest earn nothing.<\/p>\n<table>\n<thead>\n<tr>\n<th>Rep<\/th>\n<th>=IF(B2&gt;=C2, B2*2%, 0)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hetal<\/td>\n<td>10800<\/td>\n<\/tr>\n<tr>\n<td>Jignesh<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>Mitesh<\/td>\n<td>14700<\/td>\n<\/tr>\n<tr>\n<td>Pooja<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>Rakesh<\/td>\n<td>9000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Nested IF: more than two outcomes<\/h2>\n<p>The real incentive scheme has slabs. Achievement of 120% or more earns 5% of sales, 100% or more earns 3%, 80% or more earns 1%, and anything below 80% earns nothing. That is four outcomes, so one IF is not enough. Each extra outcome goes inside the previous IF&#8217;s false slot.<\/p>\n<table>\n<thead>\n<tr>\n<th>Part of the formula<\/th>\n<th>What it checks<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>=IF(D2&gt;=120%, 5%,<\/td>\n<td>Is achievement at least 120%? If so, 5%<\/td>\n<\/tr>\n<tr>\n<td>IF(D2&gt;=100%, 3%,<\/td>\n<td>If not, is it at least 100%? If so, 3%<\/td>\n<\/tr>\n<tr>\n<td>IF(D2&gt;=80%, 1%, 0)))<\/td>\n<td>If not, is it at least 80%? If so 1%, otherwise 0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Written in one line, that is =IF(D2&gt;=120%, 5%, IF(D2&gt;=100%, 3%, IF(D2&gt;=80%, 1%, 0))). Three IFs, so three closing brackets at the end. The bonus is then sales times the rate.<\/p>\n<table>\n<thead>\n<tr>\n<th>Rep<\/th>\n<th>Achievement<\/th>\n<th>Rate from the nested IF<\/th>\n<th>Bonus, =B2*F2<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hetal<\/td>\n<td>108%<\/td>\n<td>3%<\/td>\n<td>16200<\/td>\n<\/tr>\n<tr>\n<td>Jignesh<\/td>\n<td>91.1%<\/td>\n<td>1%<\/td>\n<td>4100<\/td>\n<\/tr>\n<tr>\n<td>Mitesh<\/td>\n<td>122.5%<\/td>\n<td>5%<\/td>\n<td>36750<\/td>\n<\/tr>\n<tr>\n<td>Pooja<\/td>\n<td>66.7%<\/td>\n<td>0%<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>Rakesh<\/td>\n<td>100%<\/td>\n<td>3%<\/td>\n<td>13500<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Order is everything<\/h3>\n<p>Excel stops at the first test that is TRUE. So with &#8220;at least&#8221; tests, start from the highest slab and work down. Here is the same formula with the slabs in the wrong order, starting from the lowest.<\/p>\n<table>\n<thead>\n<tr>\n<th>Rep<\/th>\n<th>Correct: =IF(D2&gt;=120%, 5%, IF(D2&gt;=100%, 3%, IF(D2&gt;=80%, 1%, 0)))<\/th>\n<th>Wrong: =IF(D2&gt;=80%, 1%, IF(D2&gt;=100%, 3%, IF(D2&gt;=120%, 5%, 0)))<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hetal<\/td>\n<td>3%<\/td>\n<td>1%<\/td>\n<\/tr>\n<tr>\n<td>Jignesh<\/td>\n<td>1%<\/td>\n<td>1%<\/td>\n<\/tr>\n<tr>\n<td>Mitesh<\/td>\n<td>5%<\/td>\n<td>1%<\/td>\n<\/tr>\n<tr>\n<td>Pooja<\/td>\n<td>0%<\/td>\n<td>0%<\/td>\n<\/tr>\n<tr>\n<td>Rakesh<\/td>\n<td>3%<\/td>\n<td>1%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In the wrong version, every rep at 80% or more stops at the first test and gets 1%. The formula raises no error, and Mitesh is paid 7,350 rupees instead of 36,750. The rule: with &gt;= tests, go from highest to lowest; with &lt;= tests, go from lowest to highest.<\/p>\n<h2>IFS: the same logic without the nesting<\/h2>\n<p>IFS takes pairs of test and result and returns the result for the first test that is TRUE. There is no false slot, so the catch-all goes last as the test TRUE, which is always true.<\/p>\n<table>\n<thead>\n<tr>\n<th>Formula<\/th>\n<th>Result for Hetal<\/th>\n<th>Result for Pooja<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>=IFS(D2&gt;=120%, 5%, D2&gt;=100%, 3%, D2&gt;=80%, 1%, TRUE, 0)<\/td>\n<td>3%<\/td>\n<td>0%<\/td>\n<\/tr>\n<tr>\n<td>=IFS(D2&gt;=120%, 5%, D2&gt;=100%, 3%, D2&gt;=80%, 1%)<\/td>\n<td>3%<\/td>\n<td>#N\/A<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The second row shows why the TRUE pair matters. Without it, a rep who fits no slab gets #N\/A rather than 0.<\/p>\n<p>IFS reads more easily and has no bracket counting, but it needs Excel 2019, Excel 2021 or Microsoft 365. A file that uses it shows #NAME? in Excel 2016. The same order rule applies to IFS as to nested IF. Google Sheets supports both IF and IFS.<\/p>\n<h2>IF with AND, OR and NOT<\/h2>\n<p>AND and OR let one IF test several conditions at once. AND is TRUE only if every condition is TRUE. OR is TRUE if any one of them is.<\/p>\n<p>The distributor pays the incentive only to reps who met target and whose customers have no more than two overdue invoices. It also wants a call list of reps who either missed target or have three or more overdue invoices.<\/p>\n<table>\n<thead>\n<tr>\n<th>Rep<\/th>\n<th>=IF(AND(B2&gt;=C2, E2&lt;=2), &#8220;Eligible&#8221;, &#8220;Not eligible&#8221;)<\/th>\n<th>=IF(OR(B2&lt;C2, E2&gt;=3), &#8220;Call&#8221;, &#8220;&#8221;)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Hetal<\/td>\n<td>Eligible<\/td>\n<td>blank<\/td>\n<\/tr>\n<tr>\n<td>Jignesh<\/td>\n<td>Not eligible<\/td>\n<td>Call<\/td>\n<\/tr>\n<tr>\n<td>Mitesh<\/td>\n<td>Not eligible<\/td>\n<td>Call<\/td>\n<\/tr>\n<tr>\n<td>Pooja<\/td>\n<td>Not eligible<\/td>\n<td>Call<\/td>\n<\/tr>\n<tr>\n<td>Rakesh<\/td>\n<td>Eligible<\/td>\n<td>blank<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Mitesh beat target by the widest margin and is still not eligible, because of his four overdue invoices. That is the business rule working as intended, and exactly the case worth testing when you build a formula like this.<\/p>\n<p>NOT reverses a test: =IF(NOT(E2=0), &#8220;Has dues&#8221;, &#8220;Clear&#8221;) returns Has dues for Hetal, Mitesh and Pooja. Most people find E2&lt;&gt;0 easier to read, and it does the same thing.<\/p>\n<h2>IF on text: exact and partial matches<\/h2>\n<p>Text tests in IF are not case-sensitive, so F2=&#8221;overdue&#8221; matches Overdue. They are exact, though, so &#8220;Overdue &#8221; with a trailing space does not match. For a partial match, combine SEARCH, which finds text inside text, with ISNUMBER.<\/p>\n<table>\n<thead>\n<tr>\n<th>A: Item description<\/th>\n<th>=IF(ISNUMBER(SEARCH(&#8220;silk&#8221;, A2)), &#8220;Silk&#8221;, &#8220;Other&#8221;)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Banarasi silk saree<\/td>\n<td>Silk<\/td>\n<\/tr>\n<tr>\n<td>Cotton kurta fabric<\/td>\n<td>Other<\/td>\n<\/tr>\n<tr>\n<td>Silk blend dupatta<\/td>\n<td>Silk<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>SEARCH returns a position number when it finds the text and an error when it does not, so ISNUMBER turns that into TRUE or FALSE.<\/p>\n<h2>When to stop nesting and use a table<\/h2>\n<p>Nested IF gets unreadable past three or four levels, and Excel allows 64, which is not a target. When the outcomes are slabs, a small lookup table is cleaner: the slabs become data someone can edit without touching a formula.<\/p>\n<table>\n<thead>\n<tr>\n<th>A: Achievement from<\/th>\n<th>B: Rate<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>0%<\/td>\n<td>0%<\/td>\n<\/tr>\n<tr>\n<td>80%<\/td>\n<td>1%<\/td>\n<\/tr>\n<tr>\n<td>100%<\/td>\n<td>3%<\/td>\n<\/tr>\n<tr>\n<td>120%<\/td>\n<td>5%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>With that table in Slabs!A2:B5, an approximate-match lookup returns the right rate for every rep: 3% for Hetal, 1% for Jignesh, 5% for Mitesh, 0% for Pooja and 3% for Rakesh.<\/p>\n<table>\n<thead>\n<tr>\n<th>Version<\/th>\n<th>Formula<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Any Excel<\/td>\n<td>=VLOOKUP(D2, Slabs!$A$2:$B$5, 2, TRUE)<\/td>\n<\/tr>\n<tr>\n<td>Microsoft 365 and Excel 2021 onwards<\/td>\n<td>=XLOOKUP(D2, Slabs!$A$2:$A$5, Slabs!$B$2:$B$5, , -1)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The dollar signs keep the slab table fixed as the formula is copied down; our guide to <a href=\"https:\/\/www.skillovilla.com\/blogs\/kick-start-excel-absolute-and-relative-cell-referencing\">absolute and relative cell referencing<\/a> explains why. Our <a href=\"https:\/\/www.skillovilla.com\/blogs\/vlookup-xlookup-index-match\">lesson on VLOOKUP, XLOOKUP and INDEX MATCH<\/a>, part of this Excel series, covers approximate-match lookups in detail. For exact matches to a fixed list, SWITCH does the same job as a nested IF: =SWITCH(A2, &#8220;Hetal&#8221;, &#8220;West&#8221;, &#8220;Pooja&#8221;, &#8220;East&#8221;, &#8220;Central&#8221;).<\/p>\n<h2>Mistakes that make IF return the wrong answer<\/h2>\n<p>These are the errors that come up most when people check their IF formulas against the expected answer.<\/p>\n<table>\n<thead>\n<tr>\n<th>Mistake<\/th>\n<th>Example<\/th>\n<th>What happens<\/th>\n<th>Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Text without quotes<\/td>\n<td>=IF(F2=Met, 1, 0)<\/td>\n<td>#NAME? error<\/td>\n<td>=IF(F2=&#8221;Met&#8221;, 1, 0)<\/td>\n<\/tr>\n<tr>\n<td>Number in quotes<\/td>\n<td>=IF(B2&gt;=&#8221;450000&#8243;, &#8220;Met&#8221;, &#8220;Missed&#8221;)<\/td>\n<td>Missed for everyone, because Excel ranks any text above any number<\/td>\n<td>=IF(B2&gt;=450000, &#8220;Met&#8221;, &#8220;Missed&#8221;)<\/td>\n<\/tr>\n<tr>\n<td>Percentage compared with a whole number<\/td>\n<td>=IF(D2&gt;=100, 3%, 0)<\/td>\n<td>0 for everyone, because D2 holds 1.08, not 108<\/td>\n<td>=IF(D2&gt;=100%, 3%, 0) or D2&gt;=1<\/td>\n<\/tr>\n<tr>\n<td>Slabs in the wrong order<\/td>\n<td>Lowest slab tested first<\/td>\n<td>Everyone lands in the first slab<\/td>\n<td>Test the highest slab first<\/td>\n<\/tr>\n<tr>\n<td>No value_if_false<\/td>\n<td>=IF(B2&gt;=C2, &#8220;Met&#8221;)<\/td>\n<td>FALSE appears for every miss<\/td>\n<td>Always give the third argument<\/td>\n<\/tr>\n<tr>\n<td>Brackets miscounted in a nested IF<\/td>\n<td>Missing a closing bracket<\/td>\n<td>Excel refuses the formula or suggests a correction<\/td>\n<td>One closing bracket per IF at the end<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The percentage row is the subtle one. Achievement in column D is stored as a decimal even though it displays as 108%, so a test against 100 is never true. Whenever an IF returns the same answer for every row, check it on a row where you already know what it should say.<\/p>\n<h2>Frequently asked questions<\/h2>\n<h3>What is the IF formula in Excel?<\/h3>\n<p>IF returns one value when a condition is true and another when it is false. The syntax is =IF(logical_test, value_if_true, value_if_false), for example =IF(B2&gt;=C2, &#8220;Met&#8221;, &#8220;Missed&#8221;). The result can be text, a number, a calculation or another formula.<\/p>\n<h3>How do I write a nested IF formula with multiple conditions?<\/h3>\n<p>Put the next IF in the value_if_false slot of the one before it, for example =IF(D2&gt;=120%, 5%, IF(D2&gt;=100%, 3%, IF(D2&gt;=80%, 1%, 0))). Excel stops at the first true condition, so with &#8220;greater than or equal to&#8221; tests, start with the highest threshold. Close one bracket for each IF at the end.<\/p>\n<h3>What is the difference between nested IF and IFS?<\/h3>\n<p>They give the same result, but IFS lists test and result pairs in a single function instead of putting IFs inside each other, so there is no bracket counting. IFS has no false slot, so end it with TRUE and a default value. IFS needs Excel 2019, Excel 2021 or Microsoft 365, while nested IF works in every version.<\/p>\n<h3>How many IF functions can you nest in Excel?<\/h3>\n<p>Excel allows up to 64 nested IF functions. In practice anything beyond three or four levels is hard to read and easy to break. For slab-based outcomes, a lookup table with an approximate-match VLOOKUP or XLOOKUP is easier to maintain.<\/p>\n<h3>How do I use IF with two conditions in Excel?<\/h3>\n<p>Wrap the conditions in AND if both must be true, or OR if either is enough. For example, =IF(AND(B2&gt;=C2, E2&lt;=2), &#8220;Eligible&#8221;, &#8220;Not eligible&#8221;) requires sales to meet target and overdue invoices to be two or fewer. AND and OR each accept many conditions, separated by commas.<\/p>\n<h3>Why does my IF formula return FALSE?<\/h3>\n<p>The test was false and the formula has no value_if_false argument, so Excel shows FALSE by default. Add the third argument, even if it is just &#8220;&#8221; for a blank cell. If the test is false when you expected true, check for numbers stored as text, trailing spaces in text, and percentages compared against whole numbers.<\/p>\n<h2>Build the logic before the formula<\/h2>\n<p>The hard part of IF is rarely the syntax. It is writing down the business rule precisely enough, slab boundaries and all, that a formula can follow it, and then testing it on the awkward rows. That is also what an <a href=\"https:\/\/www.skillovilla.com\/blogs\/excel-interview-questions\">Excel interview<\/a> task checks. For the other formulas IF usually sits beside, such as <a href=\"https:\/\/www.skillovilla.com\/blogs\/excel-formulas-list\">SUMIFS and COUNTIFS<\/a>, see our guide to <a href=\"https:\/\/www.skillovilla.com\/blogs\/excel-for-data-analysis\">Excel for data analysis<\/a>.<\/p>\n<p>SkilloVilla&#8217;s <a href=\"https:\/\/www.skillovilla.com\/courses\/excel-beginner-to-advanced\">Excel: Beginner to Advanced course<\/a> has a module on conditional functions, alongside operators, lookup, text and date functions, data cleaning, pivot tables and interactive dashboards, taught in live classes by working professionals. If you want Excel inside a full analyst programme with SQL, Python and placement support, see the <a href=\"https:\/\/www.skillovilla.com\/tracks\/data-analytics-python\">Data Analytics with Python track<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The IF formula in Excel explained with examples, then nested IF, IFS, IF with AND and OR, and the mistakes that make an IF return the wrong answer.<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[202],"tags":[],"class_list":["post-4021","post","type-post","status-publish","format-standard","hentry","category-excel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>IF Formula in Excel, With Nested IF, IFS, AND and OR<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IF Formula in Excel, With Nested IF, IFS, AND and OR\" \/>\n<meta property=\"og:description\" content=\"The IF formula in Excel explained with examples, then nested IF, IFS, IF with AND and OR, and the mistakes that make an IF return the wrong answer.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel\" \/>\n<meta property=\"og:site_name\" content=\"SkilloVilla\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-23T16:49:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-23T17:51:18+00:00\" \/>\n<meta name=\"author\" content=\"SkilloVilla Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"SkilloVilla Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel\"},\"author\":{\"name\":\"SkilloVilla Team\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/f64a2675b6d238b7e44744a87e5c4943\"},\"headline\":\"IF Formula in Excel, With Nested IF, IFS, AND and OR\",\"datePublished\":\"2026-11-23T16:49:52+00:00\",\"dateModified\":\"2026-11-23T17:51:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel\"},\"wordCount\":1986,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#organization\"},\"articleSection\":[\"excel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel\",\"url\":\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel\",\"name\":\"IF Formula in Excel, With Nested IF, IFS, AND and OR\",\"isPartOf\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#website\"},\"datePublished\":\"2026-11-23T16:49:52+00:00\",\"dateModified\":\"2026-11-23T17:51:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.skillovilla.com\/blogs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IF Formula in Excel, With Nested IF, IFS, AND and OR\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#website\",\"url\":\"https:\/\/www.skillovilla.com\/blogs\/\",\"name\":\"SkilloVilla\",\"description\":\"Data careers, taught live\",\"publisher\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.skillovilla.com\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#organization\",\"name\":\"SkilloVilla\",\"url\":\"https:\/\/www.skillovilla.com\/blogs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.skillovilla.com\/blogs\/wp-content\/uploads\/2021\/07\/logo-thumbnail.png\",\"contentUrl\":\"https:\/\/www.skillovilla.com\/blogs\/wp-content\/uploads\/2021\/07\/logo-thumbnail.png\",\"width\":1200,\"height\":627,\"caption\":\"SkilloVilla\"},\"image\":{\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/f64a2675b6d238b7e44744a87e5c4943\",\"name\":\"SkilloVilla Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5e0b6f9e8405f5d6fc302700051e351ffa38fb1cf2709a0cb4e96b5622c497d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5e0b6f9e8405f5d6fc302700051e351ffa38fb1cf2709a0cb4e96b5622c497d0?s=96&d=mm&r=g\",\"caption\":\"SkilloVilla Team\"},\"url\":\"https:\/\/www.skillovilla.com\/blogs\/author\/sankalp_agarwal\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"IF Formula in Excel, With Nested IF, IFS, AND and OR","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:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel","og_locale":"en_US","og_type":"article","og_title":"IF Formula in Excel, With Nested IF, IFS, AND and OR","og_description":"The IF formula in Excel explained with examples, then nested IF, IFS, IF with AND and OR, and the mistakes that make an IF return the wrong answer.","og_url":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel","og_site_name":"SkilloVilla","article_published_time":"2026-11-23T16:49:52+00:00","article_modified_time":"2026-11-23T17:51:18+00:00","author":"SkilloVilla Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"SkilloVilla Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel#article","isPartOf":{"@id":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel"},"author":{"name":"SkilloVilla Team","@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/f64a2675b6d238b7e44744a87e5c4943"},"headline":"IF Formula in Excel, With Nested IF, IFS, AND and OR","datePublished":"2026-11-23T16:49:52+00:00","dateModified":"2026-11-23T17:51:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel"},"wordCount":1986,"commentCount":0,"publisher":{"@id":"https:\/\/www.skillovilla.com\/blogs\/#organization"},"articleSection":["excel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel","url":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel","name":"IF Formula in Excel, With Nested IF, IFS, AND and OR","isPartOf":{"@id":"https:\/\/www.skillovilla.com\/blogs\/#website"},"datePublished":"2026-11-23T16:49:52+00:00","dateModified":"2026-11-23T17:51:18+00:00","breadcrumb":{"@id":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.skillovilla.com\/blogs\/if-formula-in-excel#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.skillovilla.com\/blogs"},{"@type":"ListItem","position":2,"name":"IF Formula in Excel, With Nested IF, IFS, AND and OR"}]},{"@type":"WebSite","@id":"https:\/\/www.skillovilla.com\/blogs\/#website","url":"https:\/\/www.skillovilla.com\/blogs\/","name":"SkilloVilla","description":"Data careers, taught live","publisher":{"@id":"https:\/\/www.skillovilla.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.skillovilla.com\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.skillovilla.com\/blogs\/#organization","name":"SkilloVilla","url":"https:\/\/www.skillovilla.com\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/www.skillovilla.com\/blogs\/wp-content\/uploads\/2021\/07\/logo-thumbnail.png","contentUrl":"https:\/\/www.skillovilla.com\/blogs\/wp-content\/uploads\/2021\/07\/logo-thumbnail.png","width":1200,"height":627,"caption":"SkilloVilla"},"image":{"@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/f64a2675b6d238b7e44744a87e5c4943","name":"SkilloVilla Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.skillovilla.com\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5e0b6f9e8405f5d6fc302700051e351ffa38fb1cf2709a0cb4e96b5622c497d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5e0b6f9e8405f5d6fc302700051e351ffa38fb1cf2709a0cb4e96b5622c497d0?s=96&d=mm&r=g","caption":"SkilloVilla Team"},"url":"https:\/\/www.skillovilla.com\/blogs\/author\/sankalp_agarwal"}]}},"_links":{"self":[{"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/posts\/4021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/comments?post=4021"}],"version-history":[{"count":2,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/posts\/4021\/revisions"}],"predecessor-version":[{"id":4080,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/posts\/4021\/revisions\/4080"}],"wp:attachment":[{"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/media?parent=4021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/categories?post=4021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skillovilla.com\/blogs\/wp-json\/wp\/v2\/tags?post=4021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}