• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Excel YEARFRAC Function

You are here: Home / Excel Functions / Excel YEARFRAC Function

The Excel YEARFRAC function returns the year fraction representing the number of whole days between start_date and end_date serial numbers.

This function is useful for calculating the portion of a whole year for use in other calculations and is particularly useful in HR/employee related calculations.

Excel YEARFRAC Function Syntax

Syntax: =YEARFRAC(start_date, end_date, [basis])
start_date A date in a format Excel recognises known as the date-time serial number, or text
end_date A date in a format Excel recognises known as the date-time serial number, or text
[basis] This optional argument allows you to specify the day count method from the list of options below. If omitted, it defaults to 0. Excel YEARFRAC Function 1
 

Excel YEARFRAC Function Examples

Excel YEARFRAC Function 2

Tip: You're most likely to use basis 1, unless your business uses a specific system.

Note 1: #NUM! Errors are returned if the basis argument is <0 or >4.

emoticonNote 2: Only the date portion of a date-time serial number is used by YEARFRAC. Any time element is ignored. As a result, only whole days are returned.

Free eBook - Working with Date & Time in Excel

Everything you need to know about Date and Time in Excel, including all Date functions explained with examples - Download the free eBook and Excel file with detailed instructions.

Enter your email address below to download the sample workbook.

By submitting your email address you agree that we can email you our Excel newsletter.
Please enter a valid email address.

Download the Excel Workbook and PDF. Note: This is a zip file including an Excel workbook with detailed instructions and a PDF version for your reference.

Related Tutorials

Excel NETWORKDAYS Function Returns the number of whole networkdays (excluding weekends & holidays), between two dates
Excel NETWORKDAYS.INTL Function Returns the number of whole networkdays (excluding weekends & holidays), between two dates, using parameters to specify weekend days
Excel DAYS Function Calculates the number of days between 2 dates
Excel DAYS360 Function Calculates the number of days between 2 dates, based on a 360-day year (12 x 30-day months)
Excel DATEDIF Function Calculates the number of days, months, or years between two dates. This function is useful in formulas where you need to calculate an age.

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.