SlideShare a Scribd company logo
1 of 27
Leap Years and More
@bethbrains
Beth Breisnes
Consultant, Bigger Boat Consulting
Fearless Date Formulas
Forward-Looking Statements
Statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any
of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking
statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or
service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for
future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts
or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our
service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth,
interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible
mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our
employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com
products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of
salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most
recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information
section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not
be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available.
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Who cares about dates?
Birthdays
Membership dates
Expiration dates
Program dates
Anniversaries
Where we’re headed…
Key Date Functions
3 Key Considerations to avoid Leap Year errors
Deep Dive on Two Bulletproof Date Formulas
BOO!
HAPPY BIRTHDAY, ASTRO!
The Date Function Machine
INPUT OUTPUT
The Date Function Machine
Date Number
DAY(Date__c)
The Date Function Machine
Date Number
MONTH(Date__c)
The Date Function Machine
Date Number
YEAR(Date__c)
The Date Function Machine
NOTHING Date
TODAY( )TODAY()
The Date Function Machine
NOTHING DateTime
NOW( )NOW()
The Date Function Machine
3 Numbers Date
DATE(yyyy,mm,dd)
The Date Function Machine
DateTime Date
DATEVALUE(DateTime__c)
The Date Function Machine
Ready for a test drive?
The Date Function Machine
Oct 6, 2016 2016
YEAR(TODAY())
The Date Function Machine
Oct 6, 2016
3:00 PM 10
MONTH(DATEVALUE(NOW()))
But isn’t date math easy?
OCT
1 + 5 =
OCT
6
Membership/Contract Expiration Date
(add 1year-1day to a date)
OCT
1 +364=
SEPT
30
Membership/Contract Expiration Date
(add 1year-1day to a date)
OCT
1
2015
+364=
SEPT
29
2016
O HAI!
The Big Trap: Leap Years
When do leap years happen?
You don’t
need to
know!
The Big Trap: Three Key Considerations
1. INPUTS
2. OUTPUTS
3. SPANS
Calculate Membership/Contract Expiry Date
IF ( MONTH (Join_Date__c) = 2 && DAY (Join_Date__c) = 29,
Join_Date__c + 365,
DATE( YEAR(Join_Date__c) + 1,
MONTH(Join_Date__c),
DAY (Join_Date__c))
-1
)
(add 1year-1day to a date)
Modified from Celeste Keller, Salesforce Saint
Calculate Birthday This Year… maybe…
DATE(YEAR(TODAY()), MONTH(Birthdate), DAY(Birthdate))
(SPOILER ALERT: THIS IS A HORRIBLE FORMULA. DON’T USE THIS.)
Find the month/day
Put it in this year
1. What if their birthday has
already passed this year?
2. What if they were born on a
leap day?
Calculate Next Birthday
IF ( MONTH (Birthdate) = 2 && DAY (Birthdate) = 29,
IF ( TODAY() < DATE ( YEAR ( TODAY() ), 1, 1 ) + 59,
DATE ( YEAR ( TODAY() ), 1, 1) + 59,
DATE ( YEAR ( TODAY() )+1, 1, 1) + 59),
IF ( TODAY() < DATE (YEAR(TODAY()),MONTH(Birthdate),DAY(Birthdate)),
DATE(YEAR(TODAY()),MONTH(Birthdate),DAY(Birthdate)),
DATE(YEAR(TODAY())+1,MONTH(Birthdate),DAY(Birthdate))
)
)
Conquer Leap Years
Always consider your…
1. Inputs
2. Outputs
3. Time spans
@bethbrains
Advanced Formulas
Thank Y u

More Related Content

What's hot

Trailblazer community - Einstein for Service.pdf
Trailblazer community - Einstein for Service.pdfTrailblazer community - Einstein for Service.pdf
Trailblazer community - Einstein for Service.pdfyosra Saidani
 
Salesforce intro session_for_students_v2
Salesforce intro session_for_students_v2Salesforce intro session_for_students_v2
Salesforce intro session_for_students_v2Stephen Edache Paul
 
Salesforce com-architecture
Salesforce com-architectureSalesforce com-architecture
Salesforce com-architecturedrewz lin
 
Apex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard ProblemsApex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard ProblemsSalesforce Developers
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce IntegrationJoshua Hoskins
 
Best Practices and Tools for Backing Up Salesforce Data
Best Practices and Tools for Backing Up Salesforce DataBest Practices and Tools for Backing Up Salesforce Data
Best Practices and Tools for Backing Up Salesforce DataSalesforce Admins
 
Secure Coding: Field-level Security, CRUD, and Sharing
Secure Coding: Field-level Security, CRUD, and SharingSecure Coding: Field-level Security, CRUD, and Sharing
Secure Coding: Field-level Security, CRUD, and SharingSalesforce Developers
 
Salesforce Service Cloud
Salesforce Service CloudSalesforce Service Cloud
Salesforce Service Cloudsharad soni
 
Making External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceMaking External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceSalesforce Developers
 
Automate All The Things with Flow
Automate All The Things with FlowAutomate All The Things with Flow
Automate All The Things with FlowSalesforce Admins
 
Why Flow with Salesforce Flow
Why Flow with Salesforce FlowWhy Flow with Salesforce Flow
Why Flow with Salesforce FlowAjeet Singh
 
Introduction to Salesforce.com
Introduction to Salesforce.comIntroduction to Salesforce.com
Introduction to Salesforce.comEdureka!
 
Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoSalesforce Developers
 
Salesforce Overview For Beginners/Students
Salesforce Overview For Beginners/StudentsSalesforce Overview For Beginners/Students
Salesforce Overview For Beginners/StudentsSujesh Ramachandran
 
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce IntroductionSalesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce IntroductionHabilelabs
 
Salesforce Service Cloud - An overview
Salesforce Service Cloud - An overviewSalesforce Service Cloud - An overview
Salesforce Service Cloud - An overviewAjay Balakrishnan
 
Salesforce Sales Cloud: Best Practices to Win More Deals
Salesforce Sales Cloud: Best Practices to Win More DealsSalesforce Sales Cloud: Best Practices to Win More Deals
Salesforce Sales Cloud: Best Practices to Win More DealsCloud Analogy
 
Tips and tricks for reports and dashboards
Tips and tricks for reports and dashboardsTips and tricks for reports and dashboards
Tips and tricks for reports and dashboardsSalesforce Admins
 

What's hot (20)

Trailblazer community - Einstein for Service.pdf
Trailblazer community - Einstein for Service.pdfTrailblazer community - Einstein for Service.pdf
Trailblazer community - Einstein for Service.pdf
 
Salesforce intro session_for_students_v2
Salesforce intro session_for_students_v2Salesforce intro session_for_students_v2
Salesforce intro session_for_students_v2
 
Salesforce com-architecture
Salesforce com-architectureSalesforce com-architecture
Salesforce com-architecture
 
Apex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard ProblemsApex Trigger Debugging: Solving the Hard Problems
Apex Trigger Debugging: Solving the Hard Problems
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
Best Practices and Tools for Backing Up Salesforce Data
Best Practices and Tools for Backing Up Salesforce DataBest Practices and Tools for Backing Up Salesforce Data
Best Practices and Tools for Backing Up Salesforce Data
 
Secure Coding: Field-level Security, CRUD, and Sharing
Secure Coding: Field-level Security, CRUD, and SharingSecure Coding: Field-level Security, CRUD, and Sharing
Secure Coding: Field-level Security, CRUD, and Sharing
 
Salesforce Service Cloud
Salesforce Service CloudSalesforce Service Cloud
Salesforce Service Cloud
 
Making External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceMaking External Web Pages Interact With Visualforce
Making External Web Pages Interact With Visualforce
 
Success Cloud at Innovation day
Success Cloud at Innovation daySuccess Cloud at Innovation day
Success Cloud at Innovation day
 
Automate All The Things with Flow
Automate All The Things with FlowAutomate All The Things with Flow
Automate All The Things with Flow
 
Why Flow with Salesforce Flow
Why Flow with Salesforce FlowWhy Flow with Salesforce Flow
Why Flow with Salesforce Flow
 
Introduction to Salesforce.com
Introduction to Salesforce.comIntroduction to Salesforce.com
Introduction to Salesforce.com
 
Understanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We DoUnderstanding the Salesforce Architecture: How We Do the Magic We Do
Understanding the Salesforce Architecture: How We Do the Magic We Do
 
Salesforce Overview For Beginners/Students
Salesforce Overview For Beginners/StudentsSalesforce Overview For Beginners/Students
Salesforce Overview For Beginners/Students
 
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce IntroductionSalesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
 
Apex Design Patterns
Apex Design PatternsApex Design Patterns
Apex Design Patterns
 
Salesforce Service Cloud - An overview
Salesforce Service Cloud - An overviewSalesforce Service Cloud - An overview
Salesforce Service Cloud - An overview
 
Salesforce Sales Cloud: Best Practices to Win More Deals
Salesforce Sales Cloud: Best Practices to Win More DealsSalesforce Sales Cloud: Best Practices to Win More Deals
Salesforce Sales Cloud: Best Practices to Win More Deals
 
Tips and tricks for reports and dashboards
Tips and tricks for reports and dashboardsTips and tricks for reports and dashboards
Tips and tricks for reports and dashboards
 

Similar to Fearless Date Formulas: Leap Years and More by Beth Breisnes

Getting Started with Salesforce for Non-Profits by Nik Panter
Getting Started with Salesforce for Non-Profits by Nik PanterGetting Started with Salesforce for Non-Profits by Nik Panter
Getting Started with Salesforce for Non-Profits by Nik PanterSalesforce Admins
 
Getting Starting with Salesforce for Nonprofits
Getting Starting with Salesforce for NonprofitsGetting Starting with Salesforce for Nonprofits
Getting Starting with Salesforce for NonprofitsNik Panter
 
Fun with Date Functions, Formulas, and Birthdays
Fun with Date Functions, Formulas, and BirthdaysFun with Date Functions, Formulas, and Birthdays
Fun with Date Functions, Formulas, and Birthdaysbbrei
 
Spring '19 Release-in-a-Box
Spring '19 Release-in-a-BoxSpring '19 Release-in-a-Box
Spring '19 Release-in-a-BoxMarc Lester
 
Enhancing Your Lightning Apps with Einstein Analytics
Enhancing Your Lightning Apps with Einstein AnalyticsEnhancing Your Lightning Apps with Einstein Analytics
Enhancing Your Lightning Apps with Einstein Analyticsrikkehovgaard
 
Build AI-Powered Predictions with Einstein Prediction Builder
Build AI-Powered Predictions with Einstein Prediction BuilderBuild AI-Powered Predictions with Einstein Prediction Builder
Build AI-Powered Predictions with Einstein Prediction BuilderSalesforce Admins
 
Adam Gross - The Second Decade of PaaS: What’s Next for Cloud Development
Adam Gross - The Second Decade of PaaS: What’s Next for Cloud DevelopmentAdam Gross - The Second Decade of PaaS: What’s Next for Cloud Development
Adam Gross - The Second Decade of PaaS: What’s Next for Cloud DevelopmentTuring Fest
 
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, AnywhereData Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, AnywhereSalesforce Developers
 
Platform Events: How developers and admins work together to implement busines...
Platform Events: How developers and admins work together to implement busines...Platform Events: How developers and admins work together to implement busines...
Platform Events: How developers and admins work together to implement busines...YeurDreamin'
 
Customizing Chatter UI Using Chatter Connect API
Customizing Chatter UI Using Chatter Connect APICustomizing Chatter UI Using Chatter Connect API
Customizing Chatter UI Using Chatter Connect APISalesforce Developers
 
Salesforce Case Study: Blaze a Trail with More Engaging Content
Salesforce Case Study: Blaze a Trail with More Engaging ContentSalesforce Case Study: Blaze a Trail with More Engaging Content
Salesforce Case Study: Blaze a Trail with More Engaging ContentGavin Austin
 
Choose your Destiny - Building your Awesome Admin Career - Video Link: http:/...
Choose your Destiny - Building your Awesome Admin Career - Video Link: http:/...Choose your Destiny - Building your Awesome Admin Career - Video Link: http:/...
Choose your Destiny - Building your Awesome Admin Career - Video Link: http:/...Deepa Patel
 
Detroit ELEVATE Track 1
Detroit ELEVATE Track 1Detroit ELEVATE Track 1
Detroit ELEVATE Track 1Joshua Birk
 
Improve Home Healthcare Outcomes with Force.com & the Internet of Things
Improve Home Healthcare Outcomes with Force.com & the Internet of ThingsImprove Home Healthcare Outcomes with Force.com & the Internet of Things
Improve Home Healthcare Outcomes with Force.com & the Internet of ThingsSalesforce Developers
 
July 2020 Chicago Nonprofit Group - Summer '20 Highlights
July 2020 Chicago Nonprofit Group - Summer '20 HighlightsJuly 2020 Chicago Nonprofit Group - Summer '20 Highlights
July 2020 Chicago Nonprofit Group - Summer '20 Highlightscsupilowski
 
Modern Architectures: The Road to App Cloud 2020
Modern Architectures: The Road to App Cloud 2020Modern Architectures: The Road to App Cloud 2020
Modern Architectures: The Road to App Cloud 2020Dreamforce
 
Using Salesforce to Manage Your Developer Community
Using Salesforce to Manage Your Developer CommunityUsing Salesforce to Manage Your Developer Community
Using Salesforce to Manage Your Developer CommunityPat Patterson
 

Similar to Fearless Date Formulas: Leap Years and More by Beth Breisnes (20)

Getting Started with Salesforce for Non-Profits by Nik Panter
Getting Started with Salesforce for Non-Profits by Nik PanterGetting Started with Salesforce for Non-Profits by Nik Panter
Getting Started with Salesforce for Non-Profits by Nik Panter
 
Getting Starting with Salesforce for Nonprofits
Getting Starting with Salesforce for NonprofitsGetting Starting with Salesforce for Nonprofits
Getting Starting with Salesforce for Nonprofits
 
Fun with Date Functions, Formulas, and Birthdays
Fun with Date Functions, Formulas, and BirthdaysFun with Date Functions, Formulas, and Birthdays
Fun with Date Functions, Formulas, and Birthdays
 
Spring '19 Release-in-a-Box
Spring '19 Release-in-a-BoxSpring '19 Release-in-a-Box
Spring '19 Release-in-a-Box
 
Enhancing Your Lightning Apps with Einstein Analytics
Enhancing Your Lightning Apps with Einstein AnalyticsEnhancing Your Lightning Apps with Einstein Analytics
Enhancing Your Lightning Apps with Einstein Analytics
 
Build AI-Powered Predictions with Einstein Prediction Builder
Build AI-Powered Predictions with Einstein Prediction BuilderBuild AI-Powered Predictions with Einstein Prediction Builder
Build AI-Powered Predictions with Einstein Prediction Builder
 
Adam Gross - The Second Decade of PaaS: What’s Next for Cloud Development
Adam Gross - The Second Decade of PaaS: What’s Next for Cloud DevelopmentAdam Gross - The Second Decade of PaaS: What’s Next for Cloud Development
Adam Gross - The Second Decade of PaaS: What’s Next for Cloud Development
 
Introduction to Einstein Bots
Introduction to Einstein Bots Introduction to Einstein Bots
Introduction to Einstein Bots
 
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, AnywhereData Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
Data Democracy: Use Lightning Connect & Heroku to Visualize any Data, Anywhere
 
Innovations from Dreamforce
Innovations from DreamforceInnovations from Dreamforce
Innovations from Dreamforce
 
Platform Events: How developers and admins work together to implement busines...
Platform Events: How developers and admins work together to implement busines...Platform Events: How developers and admins work together to implement busines...
Platform Events: How developers and admins work together to implement busines...
 
Customizing Chatter UI Using Chatter Connect API
Customizing Chatter UI Using Chatter Connect APICustomizing Chatter UI Using Chatter Connect API
Customizing Chatter UI Using Chatter Connect API
 
Salesforce Case Study: Blaze a Trail with More Engaging Content
Salesforce Case Study: Blaze a Trail with More Engaging ContentSalesforce Case Study: Blaze a Trail with More Engaging Content
Salesforce Case Study: Blaze a Trail with More Engaging Content
 
Choose your Destiny - Building your Awesome Admin Career - Video Link: http:/...
Choose your Destiny - Building your Awesome Admin Career - Video Link: http:/...Choose your Destiny - Building your Awesome Admin Career - Video Link: http:/...
Choose your Destiny - Building your Awesome Admin Career - Video Link: http:/...
 
Detroit ELEVATE Track 1
Detroit ELEVATE Track 1Detroit ELEVATE Track 1
Detroit ELEVATE Track 1
 
Winter '18 開発者向け新機能
Winter '18 開発者向け新機能Winter '18 開発者向け新機能
Winter '18 開発者向け新機能
 
Improve Home Healthcare Outcomes with Force.com & the Internet of Things
Improve Home Healthcare Outcomes with Force.com & the Internet of ThingsImprove Home Healthcare Outcomes with Force.com & the Internet of Things
Improve Home Healthcare Outcomes with Force.com & the Internet of Things
 
July 2020 Chicago Nonprofit Group - Summer '20 Highlights
July 2020 Chicago Nonprofit Group - Summer '20 HighlightsJuly 2020 Chicago Nonprofit Group - Summer '20 Highlights
July 2020 Chicago Nonprofit Group - Summer '20 Highlights
 
Modern Architectures: The Road to App Cloud 2020
Modern Architectures: The Road to App Cloud 2020Modern Architectures: The Road to App Cloud 2020
Modern Architectures: The Road to App Cloud 2020
 
Using Salesforce to Manage Your Developer Community
Using Salesforce to Manage Your Developer CommunityUsing Salesforce to Manage Your Developer Community
Using Salesforce to Manage Your Developer Community
 

More from Salesforce Admins

Admin Best Practices: Dashboards for Every Admin
Admin Best Practices: Dashboards for Every AdminAdmin Best Practices: Dashboards for Every Admin
Admin Best Practices: Dashboards for Every AdminSalesforce Admins
 
Admin Best Practices: Building Useful Formulas
Admin Best Practices: Building Useful FormulasAdmin Best Practices: Building Useful Formulas
Admin Best Practices: Building Useful FormulasSalesforce Admins
 
Admin Best Practices: 3 Steps to Seamless Deployments
Admin Best Practices: 3 Steps to Seamless DeploymentsAdmin Best Practices: 3 Steps to Seamless Deployments
Admin Best Practices: 3 Steps to Seamless DeploymentsSalesforce Admins
 
Awesome Admins Automate: Integrate Flow with AI and Chatbots
Awesome Admins Automate: Integrate Flow with AI and ChatbotsAwesome Admins Automate: Integrate Flow with AI and Chatbots
Awesome Admins Automate: Integrate Flow with AI and ChatbotsSalesforce Admins
 
#AwesomeAdmins Automate: Create Triggered Flows and Batch Jobs
#AwesomeAdmins Automate:  Create Triggered Flows and Batch Jobs#AwesomeAdmins Automate:  Create Triggered Flows and Batch Jobs
#AwesomeAdmins Automate: Create Triggered Flows and Batch JobsSalesforce Admins
 
Admin Best Practices: Introducing Einstein Recommendation Builder
Admin Best Practices: Introducing Einstein Recommendation BuilderAdmin Best Practices: Introducing Einstein Recommendation Builder
Admin Best Practices: Introducing Einstein Recommendation BuilderSalesforce Admins
 
Admin Best Practices: Remove Security Risk From Your Org with a User Audit
Admin Best Practices: Remove Security Risk From Your Org with a User AuditAdmin Best Practices: Remove Security Risk From Your Org with a User Audit
Admin Best Practices: Remove Security Risk From Your Org with a User AuditSalesforce Admins
 
Essential Habits for New Admins
Essential Habits for New AdminsEssential Habits for New Admins
Essential Habits for New AdminsSalesforce Admins
 
Essential Habits for Salesforce Admins: Actionable Analytics
Essential Habits for Salesforce Admins: Actionable AnalyticsEssential Habits for Salesforce Admins: Actionable Analytics
Essential Habits for Salesforce Admins: Actionable AnalyticsSalesforce Admins
 
Essential Habits for Salesforce Admins: Security
Essential Habits for Salesforce Admins: SecurityEssential Habits for Salesforce Admins: Security
Essential Habits for Salesforce Admins: SecuritySalesforce Admins
 
Essential Habits for Salesforce Admins: Data Management
Essential Habits for Salesforce Admins: Data ManagementEssential Habits for Salesforce Admins: Data Management
Essential Habits for Salesforce Admins: Data ManagementSalesforce Admins
 
Essential Habits for Salesforce Admins: User Management
Essential Habits for Salesforce Admins: User ManagementEssential Habits for Salesforce Admins: User Management
Essential Habits for Salesforce Admins: User ManagementSalesforce Admins
 
Admin Best Practices: Explore the Power of Data with Tableau
Admin Best Practices: Explore the Power of Data with TableauAdmin Best Practices: Explore the Power of Data with Tableau
Admin Best Practices: Explore the Power of Data with TableauSalesforce Admins
 
Essential Habits for New Admins
Essential Habits for New AdminsEssential Habits for New Admins
Essential Habits for New AdminsSalesforce Admins
 
Admin trailhead Live: Leverage Einstein Search to Increase Productivity
Admin trailhead Live: Leverage Einstein Search to Increase ProductivityAdmin trailhead Live: Leverage Einstein Search to Increase Productivity
Admin trailhead Live: Leverage Einstein Search to Increase ProductivitySalesforce Admins
 
Admin Best Practices: Reports & Dashboards
Admin Best Practices: Reports & DashboardsAdmin Best Practices: Reports & Dashboards
Admin Best Practices: Reports & DashboardsSalesforce Admins
 
Trailhead Live: Essential Habits & Core Admin Responsibilities
Trailhead Live: Essential Habits & Core Admin ResponsibilitiesTrailhead Live: Essential Habits & Core Admin Responsibilities
Trailhead Live: Essential Habits & Core Admin ResponsibilitiesSalesforce Admins
 
Trailhead Live: Build an Awesome Team of Admins
Trailhead Live: Build an Awesome Team of AdminsTrailhead Live: Build an Awesome Team of Admins
Trailhead Live: Build an Awesome Team of AdminsSalesforce Admins
 
Semper Salesforce: Become a Salesforce Military Champion
Semper Salesforce: Become a Salesforce Military ChampionSemper Salesforce: Become a Salesforce Military Champion
Semper Salesforce: Become a Salesforce Military ChampionSalesforce Admins
 
WT19: An Amazing Lightning Transition in Review
WT19: An Amazing Lightning Transition in ReviewWT19: An Amazing Lightning Transition in Review
WT19: An Amazing Lightning Transition in ReviewSalesforce Admins
 

More from Salesforce Admins (20)

Admin Best Practices: Dashboards for Every Admin
Admin Best Practices: Dashboards for Every AdminAdmin Best Practices: Dashboards for Every Admin
Admin Best Practices: Dashboards for Every Admin
 
Admin Best Practices: Building Useful Formulas
Admin Best Practices: Building Useful FormulasAdmin Best Practices: Building Useful Formulas
Admin Best Practices: Building Useful Formulas
 
Admin Best Practices: 3 Steps to Seamless Deployments
Admin Best Practices: 3 Steps to Seamless DeploymentsAdmin Best Practices: 3 Steps to Seamless Deployments
Admin Best Practices: 3 Steps to Seamless Deployments
 
Awesome Admins Automate: Integrate Flow with AI and Chatbots
Awesome Admins Automate: Integrate Flow with AI and ChatbotsAwesome Admins Automate: Integrate Flow with AI and Chatbots
Awesome Admins Automate: Integrate Flow with AI and Chatbots
 
#AwesomeAdmins Automate: Create Triggered Flows and Batch Jobs
#AwesomeAdmins Automate:  Create Triggered Flows and Batch Jobs#AwesomeAdmins Automate:  Create Triggered Flows and Batch Jobs
#AwesomeAdmins Automate: Create Triggered Flows and Batch Jobs
 
Admin Best Practices: Introducing Einstein Recommendation Builder
Admin Best Practices: Introducing Einstein Recommendation BuilderAdmin Best Practices: Introducing Einstein Recommendation Builder
Admin Best Practices: Introducing Einstein Recommendation Builder
 
Admin Best Practices: Remove Security Risk From Your Org with a User Audit
Admin Best Practices: Remove Security Risk From Your Org with a User AuditAdmin Best Practices: Remove Security Risk From Your Org with a User Audit
Admin Best Practices: Remove Security Risk From Your Org with a User Audit
 
Essential Habits for New Admins
Essential Habits for New AdminsEssential Habits for New Admins
Essential Habits for New Admins
 
Essential Habits for Salesforce Admins: Actionable Analytics
Essential Habits for Salesforce Admins: Actionable AnalyticsEssential Habits for Salesforce Admins: Actionable Analytics
Essential Habits for Salesforce Admins: Actionable Analytics
 
Essential Habits for Salesforce Admins: Security
Essential Habits for Salesforce Admins: SecurityEssential Habits for Salesforce Admins: Security
Essential Habits for Salesforce Admins: Security
 
Essential Habits for Salesforce Admins: Data Management
Essential Habits for Salesforce Admins: Data ManagementEssential Habits for Salesforce Admins: Data Management
Essential Habits for Salesforce Admins: Data Management
 
Essential Habits for Salesforce Admins: User Management
Essential Habits for Salesforce Admins: User ManagementEssential Habits for Salesforce Admins: User Management
Essential Habits for Salesforce Admins: User Management
 
Admin Best Practices: Explore the Power of Data with Tableau
Admin Best Practices: Explore the Power of Data with TableauAdmin Best Practices: Explore the Power of Data with Tableau
Admin Best Practices: Explore the Power of Data with Tableau
 
Essential Habits for New Admins
Essential Habits for New AdminsEssential Habits for New Admins
Essential Habits for New Admins
 
Admin trailhead Live: Leverage Einstein Search to Increase Productivity
Admin trailhead Live: Leverage Einstein Search to Increase ProductivityAdmin trailhead Live: Leverage Einstein Search to Increase Productivity
Admin trailhead Live: Leverage Einstein Search to Increase Productivity
 
Admin Best Practices: Reports & Dashboards
Admin Best Practices: Reports & DashboardsAdmin Best Practices: Reports & Dashboards
Admin Best Practices: Reports & Dashboards
 
Trailhead Live: Essential Habits & Core Admin Responsibilities
Trailhead Live: Essential Habits & Core Admin ResponsibilitiesTrailhead Live: Essential Habits & Core Admin Responsibilities
Trailhead Live: Essential Habits & Core Admin Responsibilities
 
Trailhead Live: Build an Awesome Team of Admins
Trailhead Live: Build an Awesome Team of AdminsTrailhead Live: Build an Awesome Team of Admins
Trailhead Live: Build an Awesome Team of Admins
 
Semper Salesforce: Become a Salesforce Military Champion
Semper Salesforce: Become a Salesforce Military ChampionSemper Salesforce: Become a Salesforce Military Champion
Semper Salesforce: Become a Salesforce Military Champion
 
WT19: An Amazing Lightning Transition in Review
WT19: An Amazing Lightning Transition in ReviewWT19: An Amazing Lightning Transition in Review
WT19: An Amazing Lightning Transition in Review
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

Fearless Date Formulas: Leap Years and More by Beth Breisnes

  • 1. Leap Years and More @bethbrains Beth Breisnes Consultant, Bigger Boat Consulting Fearless Date Formulas
  • 2. Forward-Looking Statements Statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
  • 3. Who cares about dates? Birthdays Membership dates Expiration dates Program dates Anniversaries
  • 4. Where we’re headed… Key Date Functions 3 Key Considerations to avoid Leap Year errors Deep Dive on Two Bulletproof Date Formulas BOO!
  • 6. The Date Function Machine INPUT OUTPUT
  • 7. The Date Function Machine Date Number DAY(Date__c)
  • 8. The Date Function Machine Date Number MONTH(Date__c)
  • 9. The Date Function Machine Date Number YEAR(Date__c)
  • 10. The Date Function Machine NOTHING Date TODAY( )TODAY()
  • 11. The Date Function Machine NOTHING DateTime NOW( )NOW()
  • 12. The Date Function Machine 3 Numbers Date DATE(yyyy,mm,dd)
  • 13. The Date Function Machine DateTime Date DATEVALUE(DateTime__c)
  • 14. The Date Function Machine Ready for a test drive?
  • 15. The Date Function Machine Oct 6, 2016 2016 YEAR(TODAY())
  • 16. The Date Function Machine Oct 6, 2016 3:00 PM 10 MONTH(DATEVALUE(NOW()))
  • 17. But isn’t date math easy? OCT 1 + 5 = OCT 6
  • 18. Membership/Contract Expiration Date (add 1year-1day to a date) OCT 1 +364= SEPT 30
  • 19. Membership/Contract Expiration Date (add 1year-1day to a date) OCT 1 2015 +364= SEPT 29 2016 O HAI!
  • 20. The Big Trap: Leap Years When do leap years happen? You don’t need to know!
  • 21. The Big Trap: Three Key Considerations 1. INPUTS 2. OUTPUTS 3. SPANS
  • 22. Calculate Membership/Contract Expiry Date IF ( MONTH (Join_Date__c) = 2 && DAY (Join_Date__c) = 29, Join_Date__c + 365, DATE( YEAR(Join_Date__c) + 1, MONTH(Join_Date__c), DAY (Join_Date__c)) -1 ) (add 1year-1day to a date) Modified from Celeste Keller, Salesforce Saint
  • 23. Calculate Birthday This Year… maybe… DATE(YEAR(TODAY()), MONTH(Birthdate), DAY(Birthdate)) (SPOILER ALERT: THIS IS A HORRIBLE FORMULA. DON’T USE THIS.) Find the month/day Put it in this year 1. What if their birthday has already passed this year? 2. What if they were born on a leap day?
  • 24. Calculate Next Birthday IF ( MONTH (Birthdate) = 2 && DAY (Birthdate) = 29, IF ( TODAY() < DATE ( YEAR ( TODAY() ), 1, 1 ) + 59, DATE ( YEAR ( TODAY() ), 1, 1) + 59, DATE ( YEAR ( TODAY() )+1, 1, 1) + 59), IF ( TODAY() < DATE (YEAR(TODAY()),MONTH(Birthdate),DAY(Birthdate)), DATE(YEAR(TODAY()),MONTH(Birthdate),DAY(Birthdate)), DATE(YEAR(TODAY())+1,MONTH(Birthdate),DAY(Birthdate)) ) )
  • 25. Conquer Leap Years Always consider your… 1. Inputs 2. Outputs 3. Time spans @bethbrains

Editor's Notes

  1. Key Takeaway: Salesforce is a publicly traded company. Please make your buying decisions only on the products commercially available from Salesforce. Talk Track: Before I begin, just a quick note that when considering future developments, whether by us or with any other solution provider, you should always base your purchasing decisions on what is currently available.
  2. So, who cares about dates? How many of you have at least one custom date formula field in your org? I thought so! Organizations might care about Birthdays, membership dates, expiry dates, program dates, anniversaries! The list goes on and on. Dates are cirtical pieces of data in all of our systems, so date formulas are really important for you to be confident and comfortable with as awesome admins.
  3. First, a quick roadmap. We’re gonna do a review of the key date functions that you use in date formulas. Then we’ll look at the three key considerations you need to make to avoid date formula errors And finally, we’ll take a deep dive on two bulletproof date formulas you can go use in your orgs right away. And don’t bother taking notes because I’ll be posting these formulas in an unmanaged package so you can install them straight into your sandbox or dev org. I’ll put the shortlink up at the end. So, did you all know it’s Astro’s birthday?
  4. I got Astro a present. It’s a bit nerdy. Are you ready to see it?
  5. It’s a date function machine! This fancy machine takes in inputs and gives outputs, or results. So you know when you create a custom field, the first thing it asks you is what data type you want? That’s what we’re talking about here. An input of a certain data type, and then an output of a certain data type. OK? Let’s read the instructions and see how it works!
  6. The DAY function takes in a Date and spits out a Number.
  7. The MONTH function takes in a Date and spits out a Number.
  8. The YEAR function takes in a Date and spits out a Number.
  9. Trick question – the TODAY function takes NOTHING, but needs the parentheses, and spits out a Date.
  10. Trick question – the NOW function takes NOTHING, but needs the parentheses, and spits out a DateTime.
  11. The YEAR function takes in a Date and spits out a Number.
  12. The YEAR function takes in a Date and spits out a Number.
  13. So now that we know how it works, let’s take it for a spin. If we put this in a formula, what’s it going to return?
  14. So now that we know how it works, let’s take it for a spin. If we put this in a formula, what’s it going to return?
  15. And how about this one? Awesome! Now that you’re all experts on date functions, let’s get to the formulas.
  16. You may be thinking, but Beth! Date math is easy! Yes, adding a simple number of dates like this IS easy. But what about something more complex, like an contract expiry date?
  17. You might expect to just add 364. Well this works SOME years…
  18. But what if this were October 1, 2015? What would the expiry date be? September 29! Well what happened to September 30? It got eaten by the leap year.
  19. When do leap years happen? [wait for some answers] Actually, you know what? There’s a secret It doesn’t matter. You don’t need to know. We’ll get there in a few minutes. First, I have another secret for you…
  20. So let’s look at a better Membership Expiry Date formula that accounts for these things.
  21. Let’s break this down. Right off the bat we’re allowing for the input date to be a leap day. If you joined on a leap day, Forward 365, which takes you to February 28 of the following year. Otherwise, same date next year and (4) back up a calendar day. – This allows for leap years because it doesn’t actually need to know the length of the year. Way to go! That is a rock solid formula, with some patterns you can apply to lots of date-related formulas in your orgs.
  22. OK, now Chris Duarte is telling us that today isn’t actually Astro’s birthday, but Astro’s birth date IS on their record in Salesforce. Let’s come up with a formula to calculate their next birthday. You MIGHT think you just need to find the month and day and throw it into this year, and voila! But what if their birthday has already passed this year? Then you're not getting their next birthday, you're getting their last birthday. And don't forget the big trap -- what if they were born on a leap year, but this year isn't a leap year? If you try to return February 29th in a common year, you'll get a big fat error.
  23. Calculate NEXT Birthday is a much better way of thinking about what you are actually after. This formula might look intimidating, but let's break it down. We're using some nested IF() functions. So we start with If the month of their birthday is 2, and the day of their birthday is 29 -- oh, if they're a leap year baby! OK, if they're a leap year baby, we're going to check something else. Is the 59th day of this year still greater than today, or in the future? The 59th day of the year is a great way of thinking about this, because it means we don't care if it's a leap year this year or not. We're checking for February 29 or March 1, it doesn't matter. See? I told you you didn’t need to worry about when leap years happen! So if we know they were born on Feb 29, we are basically checking if their birthday has passed or not. If it hasn't, then their next birthday is the 59th day of this year, whether that be Feb 29 or March 1. If their birthday has passed, then their next birthday is the 59th day of next year. Now we jump back out to our first IF statement for the "Else" condition, so if they are not a leap year baby. This part uses similar logic -- are we before their birthday in this year? If so, then their next birthday is the day of their birthday in this year. If their birthday this year has passed, then their next birthday is the day of their birthday next year. You made it through! You calculated your Astro’s next birthday and avoided the leap year trap! If they were born on a leap day, Are we still before feb 29/mar 1? If so, Feb 29/Mar 1 of this year is their next birthday. If not, Feb 29/Mar 1 of NEXT year is their next birthday. If they weren’t born on a leap day, are we still before their next birthday? If so, their birthday’s month and day this year is their next birthday. If not, their birthday’s month and day NEXT year is their next birthday.
  24. You are now ready to slay date formulas and never run into leap year errors! Just remember to always consider your inputs, outputs, and time spans, and you’ll be Leap Year Approved in no time! Find me on Twitter.