{"id":1358,"date":"2018-07-04T10:38:20","date_gmt":"2018-07-04T10:38:20","guid":{"rendered":"http:\/\/officetuts.net\/excel\/?p=1358"},"modified":"2023-11-03T14:43:32","modified_gmt":"2023-11-03T14:43:32","slug":"yearfrac","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/","title":{"rendered":"YEARFRAC function"},"content":{"rendered":"\n

YEARFRAC function in Excel allows you to calculate the fraction of a year between two dates, making it useful for various financial and time-based calculations. It’s a straightforward way to determine the duration between two dates, which can be beneficial for understanding interest accruals, time periods, and more.<\/p>\n\n\n\n

Syntax<\/h2>\n\n\n\n

YEARFRAC(start_date, end_date, [basis])<\/strong><\/p>\n\n\n\n

Arguments<\/h2>\n\n\n\n
start_date<\/strong><\/td>The starting date of the period.<\/td><\/tr>
end_date<\/strong><\/td>The ending date of the period.<\/td><\/tr>
[basis]<\/strong><\/td>(Optional) An optional argument that specifies the day count basis to use. If omitted, it defaults to 0 (US NASD 30\/360). You can choose from various basis options to determine the day count convention used in the calculation. For example, 0 represents US NASD 30\/360, 1 represents Actual\/Actual, and so on.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

How to use<\/h2>\n\n\n\n

Let’s see how to use the YEARFRAC function with some examples:<\/p>\n\n\n\n

Example 1:<\/strong> Calculate the fraction of a year between two dates:<\/p>\n\n\n\n

=YEARFRAC(\"2023-01-01\", \"2023-06-30\")<\/code><\/pre>\n\n\n\n

This formula calculates the fraction of a year between January 1, 2023, and June 30, 2023, using the default basis (US NASD 30\/360).<\/p>\n\n\n\n

Example 2:<\/strong> Calculate the fraction of a year using a different day count basis:<\/p>\n\n\n\n

=YEARFRAC(\"2023-01-01\", \"2023-06-30\", 1)<\/code><\/pre>\n\n\n\n

In this example, the formula calculates the year fraction using the Actual\/Actual basis, giving you a more precise result.<\/p>\n\n\n\n

Example 3:<\/strong> Calculate the year fraction between two specific dates and explain the basis:<\/p>\n\n\n\n

=YEARFRAC(\"2023-01-01\", \"2023-12-31\", 3)<\/code><\/pre>\n\n\n\n

Here, we calculate the year fraction for the entire year 2023, using the “Actual\/365 Fixed” basis, which considers the number of days in the year for the calculation.<\/p>\n\n\n\n

YEARFRAC is a versatile function that helps you with a wide range of date-related calculations, including interest calculations, time duration, and more.<\/p>\n","protected":false},"excerpt":{"rendered":"

YEARFRAC function in Excel allows you to calculate the fraction of a year between two dates, making it useful for various financial and…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[180],"yoast_head":"\nYEARFRAC function<\/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:\/\/officetuts.net\/excel\/functions\/yearfrac\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"YEARFRAC function\" \/>\n<meta property=\"og:description\" content=\"YEARFRAC function in Excel allows you to calculate the fraction of a year between two dates, making it useful for various financial and...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-04T10:38:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-03T14:43:32+00:00\" \/>\n<meta name=\"author\" content=\"Tomasz Decker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tomasz Decker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/\"},\"author\":{\"name\":\"Tomasz Decker\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"headline\":\"YEARFRAC function\",\"datePublished\":\"2018-07-04T10:38:20+00:00\",\"dateModified\":\"2023-11-03T14:43:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/\"},\"wordCount\":261,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"keywords\":[\"done\"],\"articleSection\":[\"functions\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/\",\"url\":\"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/\",\"name\":\"YEARFRAC function\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"datePublished\":\"2018-07-04T10:38:20+00:00\",\"dateModified\":\"2023-11-03T14:43:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"YEARFRAC function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"YEARFRAC function","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:\/\/officetuts.net\/excel\/functions\/yearfrac\/","og_locale":"en_US","og_type":"article","og_title":"YEARFRAC function","og_description":"YEARFRAC function in Excel allows you to calculate the fraction of a year between two dates, making it useful for various financial and...","og_url":"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/","article_published_time":"2018-07-04T10:38:20+00:00","article_modified_time":"2023-11-03T14:43:32+00:00","author":"Tomasz Decker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tomasz Decker","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/"},"author":{"name":"Tomasz Decker","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"headline":"YEARFRAC function","datePublished":"2018-07-04T10:38:20+00:00","dateModified":"2023-11-03T14:43:32+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/"},"wordCount":261,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"keywords":["done"],"articleSection":["functions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/","url":"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/","name":"YEARFRAC function","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"datePublished":"2018-07-04T10:38:20+00:00","dateModified":"2023-11-03T14:43:32+00:00","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/functions\/yearfrac\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/functions\/yearfrac\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"YEARFRAC function"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/1358"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=1358"}],"version-history":[{"count":3,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/1358\/revisions"}],"predecessor-version":[{"id":16604,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/1358\/revisions\/16604"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=1358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=1358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=1358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}