YEARFRAC Google Sheet Formula
Generate Google Sheet YEARFRAC Formulas in seconds
Interactive Formula Generator
Formula Generator
Create complex Google Sheets formulas with natural language. Simply describe what you want to calculate.
Upgrade to Sheet Alchemy Pro
Get advanced formulas, batch processing, and priority support
Input
Result
Your formula will be displayed here:
Your formula will appear here
Describe what you want to calculate and click Generate
Pro Features Available
Sheet Alchemy Pro includes additional advanced features to enhance your formula generation.
Advanced Formulas
Complex array formulas and dynamic ranges
Batch Processing
Generate multiple formulas at once
Unlimited History
Save and organize all your formulas
YEARFRAC Formula Syntax
Example Use Case
Calculating the fraction of a year between two dates
Understanding the YEARFRAC Formula
The YEARFRAC function in Excel calculates the fraction of a year between two dates, using various day count conventions. It's a time proportion tool for financial calculations—like computing partial-year interest or pro-rated annual figures.
YEARFRAC("2023-01-01", "2023-06-30", 0) returns approximately 0.5, representing half a year using the US (NASD) 30/360 day count convention. It takes start_date, end_date, and optional basis arguments (0-4 for different conventions), providing precise fractional year measurements.
Why Use YEARFRAC?
YEARFRAC computes partial years—think bond yields or accrued interest. Its multiple day-counting methods support various financial industry standards, making it essential for accurate interest calculations, depreciation, or any scenario requiring precise fractional year values.
Example with Sample Data
Date Range, [Basis] | Formula | Result |
---|---|---|
1/1/2023 to 6/30/2023, 0 | =YEARFRAC("1/1/2023", "6/30/2023", 0) | 0.5 (30/360 basis) |
1/1/2023 to 6/30/2023, 1 | =YEARFRAC("1/1/2023", "6/30/2023", 1) | 0.4959 (Actual/actual basis) |
3/1/2023 to 7/31/2023, 3 | =YEARFRAC("3/1/2023", "7/31/2023", 3) | 0.4167 (Actual/365 basis) |
YEARFRAC measures fractional years: Jan-Jun 2023 is 0.5 years in 30/360 basis. It's a year fraction calculator.
Explore More Google Sheet Formulas
IMSQRT
Calculating the square root of a complex number for complex analysis
Learn moreMINUTE
Extracting the minute component from a time value
Learn moreDAY
Extracting the day of the month from a date value
Learn moreCOUPDAYS
Calculating the number of days in the coupon period containing the settlement date
Learn moreISFORMULA
Checking if a cell contains a formula
Learn moreISPMT
Calculating the interest payment for a loan with straight-line amortization
Learn moreCUMPRINC
Calculating cumulative principal paid on a loan between two periods
Learn moreTODAY
Retrieving the current date that updates when the workbook recalculates
Learn moreUnlock the Full Power of Sheet Alchemy
Get access to all our formula generators, script generators, and conversion tools with a free Sheet Alchemy account.