{"id":1090,"date":"2010-09-07T14:31:00","date_gmt":"2010-09-07T06:31:00","guid":{"rendered":"http:\/\/vm-officeblogs.cloudapp.net\/2010\/09\/07\/true-or-false-if-provides-the-answer\/"},"modified":"2022-06-30T09:24:25","modified_gmt":"2022-06-30T16:24:25","slug":"true-or-false-if-provides-the-answer","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/","title":{"rendered":"True or false, IF provides the answer"},"content":{"rendered":"

Today\u2019s post is brought to you by Frederique Klitgaard. Frederique is a writer on Office.com<\/p>\n

It\u2019s easy to understand why the IF function appears in the top 10 list of popular Excel functions. It\u2019s a versatile function that can be used for all sorts of tasks.<\/p>\n

For example, this function can save you a lot of time when you need to grade a stack of papers. It quickly turns a long list of test scores into grades without having to do any of the math. It can also instantly determine who passed or failed.<\/p>\n

I don\u2019t ever grade papers but I\u2019ll use this example to show you the effectiveness of this function. Let\u2019s start by having a look at the syntax that this function uses to determine that a condition is true or false.<\/p>\n

IF(logical_test, [value_if_true], [value_if_false])<\/h2>\n

The first argument, logical_test<\/b>, is the required value or expression that will be evaluated to true or false. Expressions use comparison operators, such as equal to (=) or greater than (>), for example A10=100. For a list of comparison operators, see Calculation operators and precedence<\/a>.<\/p>\n

The other two arguments, value_if_true<\/b> and value_if_false<\/b>, are optional arguments (as indicated by the square brackets in the syntax). When these arguments are used in the formula, they\u2019ll return the value that you want to be displayed when the logical_test<\/b> argument evaluates to true or false.<\/p>\n

I\u2019ll  apply this syntax to the following list of test scores.<\/p>\n\n\n\n\n\n\n\n\n
Student<\/td>\nTest Score<\/td>\nResult<\/td>\nGrade<\/td>\n<\/tr>\n
Student 1<\/td>\n35<\/td>\n <\/td>\n <\/td>\n<\/tr>\n
Student 2<\/td>\n67<\/td>\n <\/td>\n <\/td>\n<\/tr>\n
Student 3<\/td>\n88<\/td>\n <\/td>\n <\/td>\n<\/tr>\n
Student 4<\/td>\n70<\/td>\n <\/td>\n <\/td>\n<\/tr>\n
Student 5<\/td>\n95<\/td>\n <\/td>\n <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

To determine who passed or failed the test, I want the formula to return the following results:<\/p>\n\n\n\n\n\n
Test score<\/b><\/td>\nResult<\/b><\/td>\n<\/tr>\n
Greater than or equal to 70<\/b><\/td>\nPassed<\/td>\n<\/tr>\n
Less than 70<\/b><\/td>\nFailed<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

In the first cell of the Result column, cell C2, I\u2019ll enter the following formula:<\/p>\n

IF(B2>=70, \u201cPassed\u201d, \u201cFailed\u201d)<\/h2>\n

To turn the list of test scores into grades, I can go a step further and embed additional IF functions as formula arguments, often referred to as nesting. You can nest up to 64 IF functions as value_if_true<\/b> and value_if_false<\/b> arguments.<\/p>\n

I want the formula to return the grades as follows:<\/p>\n\n\n\n\n\n\n\n\n
Test score<\/b><\/td>\nGrade<\/b><\/td>\n<\/tr>\n
Greater than 89<\/b><\/td>\nA<\/td>\n<\/tr>\n
From 80 to 89<\/b><\/td>\nB<\/td>\n<\/tr>\n
From 70 to 79<\/b><\/td>\nC<\/td>\n<\/tr>\n
From 60 to 69<\/b><\/td>\nD<\/td>\n<\/tr>\n
Less than 60<\/b><\/td>\nF<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Based on these conditions, the nested formula I\u2019ll enter in the first cell of the Grade column, cell D2, will then look like this:<\/p>\n

IF(B2>89, \u201cA\u201d, IF(B2>79, \u201cB\u201d, IF(B2>69, \u201cC\u201d, IF(B2>59, \u201cD\u201d, \u201cF\u201d))))<\/h2>\n

Notice that I\u2019ve nested three other IF functions to calculate the grades. The last argument doesn\u2019t need the IF function; it automatically displays an F for numbers that have not been accounted for in the nested IF functions. I\u2019ve used the IF function four times, so I\u2019ll need to include four ending parentheses in the formula.<\/p>\n\n\n\n\n\n\n\n\n
Student<\/td>\nTest Score<\/td>\nResult<\/td>\nGrade<\/td>\n<\/tr>\n
Student 1<\/td>\n35<\/td>\nFailed<\/td>\nF<\/td>\n<\/tr>\n
Student 2<\/td>\n67<\/td>\nFailed<\/td>\nD<\/td>\n<\/tr>\n
Student 3<\/td>\n88<\/td>\nPassed<\/td>\nB<\/td>\n<\/tr>\n
Student 4<\/td>\n70<\/td>\nPassed<\/td>\nC<\/td>\n<\/tr>\n
Student 5<\/td>\n95<\/td>\nPassed<\/td>\nA<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Because I used a table format, the formula is automatically applied to all test scores. If that were not the case, however, I would just fill the formula down to the other cells in the column to get my list of grades.<\/p>\n

That\u2019s all there is to it. I\u2019m ready to get my rubber stamp and grade away!<\/p>\n

I hope that the examples I used will help you become familiar with this function. For additional information and other examples, please see our function reference article, IF function<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

Today\u2019s post is brought to you by Frederique Klitgaard. Frederique is a writer on Office.com It\u2019s easy to understand why the IF function appears in the top 10 list of popular Excel functions. It\u2019s a versatile function that can be used for all sorts of tasks. For example, this function can save you a lot<\/p>\n","protected":false},"author":64,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"_classifai_error":"","footnotes":""},"content-type":[4035],"product":[4047,4036],"audience":[4087,4081],"tags":[],"coauthors":[4437],"class_list":["post-1090","post","type-post","status-publish","format-standard","hentry","content-type-tips-and-guides","product-excel","product-microsoft-365","audience-education","audience-enterprise"],"yoast_head":"\nTrue or false, IF provides the answer | Microsoft 365 Blog<\/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.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"True or false, IF provides the answer | Microsoft 365 Blog\" \/>\n<meta property=\"og:description\" content=\"Today\u2019s post is brought to you by Frederique Klitgaard. Frederique is a writer on Office.com It\u2019s easy to understand why the IF function appears in the top 10 list of popular Excel functions. It\u2019s a versatile function that can be used for all sorts of tasks. For example, this function can save you a lot\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft 365 Blog\" \/>\n<meta property=\"article:published_time\" content=\"2010-09-07T06:31:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-30T16:24:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-content\/uploads\/sites\/2\/2022\/06\/cropped-microsoft_logo_element.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"The Microsoft 365 Marketing 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=\"The Microsoft 365 Marketing Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 min read\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/\"},\"author\":[{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/author\/the-microsoft-365-marketing-team\/\",\"@type\":\"Person\",\"@name\":\"The Microsoft 365 Marketing Team\"}],\"headline\":\"True or false, IF provides the answer\",\"datePublished\":\"2010-09-07T06:31:00+00:00\",\"dateModified\":\"2022-06-30T16:24:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/\"},\"wordCount\":619,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/\",\"name\":\"True or false, IF provides the answer | Microsoft 365 Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#website\"},\"datePublished\":\"2010-09-07T06:31:00+00:00\",\"dateModified\":\"2022-06-30T16:24:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"True or false, IF provides the answer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#website\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/\",\"name\":\"Microsoft 365 Blog\",\"description\":\"Microsoft 365 brings together Office 365, Windows 10, and Enterprise Mobility + Security. It delivers a complete, intelligent, and secure solution to empower people.\",\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#organization\",\"name\":\"Microsoft 365 Blog\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-content\/uploads\/sites\/2\/2019\/08\/ms-logo-amp.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-content\/uploads\/sites\/2\/2019\/08\/ms-logo-amp.png\",\"width\":279,\"height\":60,\"caption\":\"Microsoft 365 Blog\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"True or false, IF provides the answer | Microsoft 365 Blog","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.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/","og_locale":"en_US","og_type":"article","og_title":"True or false, IF provides the answer | Microsoft 365 Blog","og_description":"Today\u2019s post is brought to you by Frederique Klitgaard. Frederique is a writer on Office.com It\u2019s easy to understand why the IF function appears in the top 10 list of popular Excel functions. It\u2019s a versatile function that can be used for all sorts of tasks. For example, this function can save you a lot","og_url":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/","og_site_name":"Microsoft 365 Blog","article_published_time":"2010-09-07T06:31:00+00:00","article_modified_time":"2022-06-30T16:24:25+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-content\/uploads\/sites\/2\/2022\/06\/cropped-microsoft_logo_element.webp","type":"image\/png"}],"author":"The Microsoft 365 Marketing Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"The Microsoft 365 Marketing Team","Est. reading time":"2 min read"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/#article","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/"},"author":[{"@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/author\/the-microsoft-365-marketing-team\/","@type":"Person","@name":"The Microsoft 365 Marketing Team"}],"headline":"True or false, IF provides the answer","datePublished":"2010-09-07T06:31:00+00:00","dateModified":"2022-06-30T16:24:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/"},"wordCount":619,"commentCount":0,"publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/","url":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/","name":"True or false, IF provides the answer | Microsoft 365 Blog","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#website"},"datePublished":"2010-09-07T06:31:00+00:00","dateModified":"2022-06-30T16:24:25+00:00","breadcrumb":{"@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/2010\/09\/07\/true-or-false-if-provides-the-answer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/"},{"@type":"ListItem","position":2,"name":"True or false, IF provides the answer"}]},{"@type":"WebSite","@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#website","url":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/","name":"Microsoft 365 Blog","description":"Microsoft 365 brings together Office 365, Windows 10, and Enterprise Mobility + Security. It delivers a complete, intelligent, and secure solution to empower people.","publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#organization","name":"Microsoft 365 Blog","url":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-content\/uploads\/sites\/2\/2019\/08\/ms-logo-amp.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-content\/uploads\/sites\/2\/2019\/08\/ms-logo-amp.png","width":279,"height":60,"caption":"Microsoft 365 Blog"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/#\/schema\/logo\/image\/"}}]}},"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft 365 Blog","distributor_original_site_url":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/posts\/1090"}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/users\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/comments?post=1090"}],"version-history":[{"count":0,"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/posts\/1090\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/media?parent=1090"}],"wp:term":[{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/content-type?post=1090"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/product?post=1090"},{"taxonomy":"audience","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/audience?post=1090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/tags?post=1090"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/blog\/wp-json\/wp\/v2\/coauthors?post=1090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}