Return previous year based on current year

This tutorial shows how to return the previous year based on the current year through the use of an Excel formula or VBA

Example: Return previous year based on current year

Return previous year based on current year

METHOD 1. Return previous year based on current year

EXCEL

=YEAR(TODAY())-1
This formula uses a combination of Excel YEAR and TODAY functions to calculate the previous year based on the current year. The formula uses the TODAY function to return today's date and then the YEAR function will return only the year of today's date. The final step subtracts 1 from the year to return the previous year, which in this example is 2018.

METHOD 1. Return previous year based on current year using VBA

VBA

Sub Previous_Year_based_on_Current_Year()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'return the previous year based on the current year
ws.Range("B5") = Format(DateAdd("yyyy", -1, Date), "yyyy")

End Sub

ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell reference ("B5") in the VBA code.
Worksheet Selection: Select the worksheet where you want to return the previous year based on the current year by changing the Analysis worksheet name in the VBA code. You can also change the name of this object variable, by changing the name 'ws' in the VBA code.

Explanation about the formulas used to return previous year based on current year

EXPLANATION

EXPLANATION

This tutorial shows and explains how to return the previous year based on the current year using an Excel formula or VBA.
This tutorial provides one Excel method that can be applied to return the previous year based on the current year with the use of the YEAR and TODAY functions. The TODAY function is used to return today's date and then using the YEAR function to only return the year. Then the formula subtracts a single year to return last year.
This tutorial provides one VBA method that can be applied to return the previous year based on the current year.
FORMULA
=YEAR(TODAY())-1)

RELATED TOPICS

Related Topic Description Related Topic and Description
How to return the next year based on the current year using Excel and VBA methods
How to return the previous month based on a specific date using Excel and VBA methods
How to return the previous month based on the current month using Excel and VBA methods
How to return the next month based on a specific date using Excel and VBA methods
How to return the next day based on a specific date using Excel and VBA methods

RELATED FUNCTIONS

Related Functions Description Related Functions and Description
The Excel YEAR function returns the year from a specified date
The Excel TODAY function returns the current date