lotto results

Wednesday, January 25, 2023

[New post] Day of the Year in Microsoft Excel

Site logo image jpluimers posted: "Given cell A1 is a valid date, I wanted to know the day of that date in that year. My solution is =A1-DATE(YEAR(A1)-1,12,13) I disliked the solution in [Wayback/Archive] Day of the Year in Microsoft Excel and [Archive] Day of the Year in Excel (In Easy " The Wiert Corner - irregular stream of stuff

Day of the Year in Microsoft Excel

jpluimers

Jan 25

Given cell A1 is a valid date, I wanted to know the day of that date in that year.

My solution is =A1-DATE(YEAR(A1)-1,12,13)

I disliked the solution in [Wayback/Archive] Day of the Year in Microsoft Excel and [Archive] Day of the Year in Excel (In Easy Steps) (excluded from the WayBack machine), as it is unclear where the + comes from in their solution =A1-DATE(YEAR(A1),1,1)+1

So, here goes my solution, with explanation:

  • =YEAR(A1) is the year of A1
  • =YEAR(A1)-1 is year before A1
  • =DATE(YEAR(A1)-1,12,13) is the last day of year before A1
  • =A1-DATE(YEAR(A1)-1,12,13) is the day of the year of A1

The last step works because subtracting two dates in Excel returns the number of days between those two dates (in a similar way, you can add a number to a date to get a new date number days in the future; similarly you can add time portions as fractions of a day).

The linked solution uses:

  • =YEAR(A1) is the year of A1
  • =DATE(YEAR(A1),1,1) is the first day of the year of A1
  • =DATE(YEAR(A1),1,1)-1 is the last day of the year before A1
  • =A1-(DATE(YEAR(A1),1,1)-1) is the day of the year of A1
  • =A1-DATE(YEAR(A1),1,1)+1 is a simplification of the day of the the year of A1

[Wayback/Archive] excel days from start of year - Google Search

--jeroen

Comment
Like
Tip icon image You can also reply to this email to leave a comment.

Unsubscribe to no longer receive posts from The Wiert Corner - irregular stream of stuff.
Change your email settings at manage subscriptions.

Trouble clicking? Copy and paste this URL into your browser:
http://wiert.me/2023/01/25/day-of-the-year-in-microsoft-excel/

Powered by WordPress.com
Download on the App Store Get it on Google Play
at January 25, 2023
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Reminder: North America Sees Slight Increase in Weighted Fiber Prices

  North America Sees Slight Increase in Weighted Fiber Prices ATH...

  • [New post] Tony Bennett Ft. Lady Gaga – You’re The Top
    Ayonline posted: " American singer, Tony Bennett come through with a new song title You're The Top Feat. Lady Gaga ...
  • [New post] The Z Blog: Money Matters
    sengssk posted: "A favorite expression is "pressure reveals character." Anyone who has played sports has probably...
  • [New post] Former Isidingo actress Kim Engelbrecht gets a nod from the 2022 Emmy Awards
    Porti...

Search This Blog

  • Home

About Me

lotto result
View my complete profile

Report Abuse

Blog Archive

  • June 2025 (3)
  • May 2025 (2)
  • March 2025 (5)
  • February 2025 (3)
  • January 2025 (4)
  • December 2024 (2)
  • November 2024 (1)
  • October 2024 (3)
  • September 2024 (4)
  • June 2023 (176)
  • May 2023 (1209)
  • April 2023 (1076)
  • March 2023 (1208)
  • February 2023 (912)
  • January 2023 (998)
  • December 2022 (1022)
  • November 2022 (1082)
  • October 2022 (1580)
  • September 2022 (1476)
  • August 2022 (1694)
  • July 2022 (1786)
  • June 2022 (1251)
  • May 2022 (1056)
  • April 2022 (1443)
  • March 2022 (1328)
  • February 2022 (1092)
  • January 2022 (1332)
  • December 2021 (1657)
  • November 2021 (3162)
  • October 2021 (3225)
  • September 2021 (3171)
  • August 2021 (3282)
  • July 2021 (1390)
Powered by Blogger.