• 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
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

I would appreciate an explanation of the attached function|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / I would appreciate an explanation of the attached function|General Excel Questions & Answers|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…I would appreciate an explanation o…
sp_PrintTopic sp_TopicIcon
I would appreciate an explanation of the attached function
Avatar
lea cohen
Member
Members
Level 0
Forum Posts: 222
Member Since:
March 10, 2016
sp_UserOfflineSmall Offline
1
July 22, 2019 - 1:31 pm
sp_Permalink sp_Print

Hi
The attachment contains the yellow cell that has a function that I do not understand,
I would appreciate if you could explain the second part of the function?
Because I need to build a similar function in another file
and it's important for me to understand what logic is here?
Thank you very much !!
Leah

sp_AnswersTopicSeeAnswer See Answer
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4519
Member Since:
July 16, 2010
sp_UserOnlineSmall Online
2
July 23, 2019 - 5:19 pm
sp_Permalink sp_Print

Hi Lea,

This is a super advanced formula that uses concepts typically only known and understood by the developers of Excel, namely broadcasting and pairwise. Here is my explanation of the last part of the formula (note: my dates are dd/mm/yyyy):

CEILING(MONTH(B4),3) - Finds the last month in the quarter. e.g. for 1st Feb 2018 it finds 3 as the last month in the qtr.

SUM(DATE(YEAR(B4),CEILING(MONTH(B4),3)+{-2,1},0) - The +{-2,1} generates two values for the Month argument in the DATE function. i.e. Where B4 = 1st Feb 2018 CEILING(MONTH(B4),3)+{-2,1} returns 1 i.e. (3-2) and 4 i.e. (3+1).

SUM(DATE(YEAR(B4),{1,4},0) - The DATE function therefore returns two dates; 43100 and 43190 (which are 31/12/2017 and 31/3/2019) This is because the zero in the day argument of DATE returns the date prior to the first date of the month in the month argument. i.e. DATE(2018,1,0) returns 31/12/2017 and DATE(2018,4,0) returns 31/3/2018

SUM({43100,43190}*{-1,1}) -*{-1,1} converts the first date to a negative and the second date to a positive so that the SUM function subtracts one from the other. It returns:

SUM({-43100,43190})

Which results in the number of days in the quarter i.e. 90

For an understanding on pairwise and broadcasting I encourage you to watch this video by Joe McDaid from the Excel team at Microsoft where he explains how arrays work in Excel.

Mynda

sp_AnswersTopicAnswer
Answers Post
Avatar
lea cohen
Member
Members
Level 0
Forum Posts: 222
Member Since:
March 10, 2016
sp_UserOfflineSmall Offline
3
July 23, 2019 - 7:22 pm
sp_Permalink sp_Print

Hey dear Minda
I thank you very much for the detailed answer and patience to answer me, I was very curious to understand the structure of the function.
Thanks!! Very appreciative !! Leah

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Mynda Treacy
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Aminu Sule
Samuel Ramirez
Abdifatah Osman
mohad borhom
Abayomi Adedeji
Ganesh MVS
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Fred Smith
Forum Stats:
Groups: 3
Forums: 24
Topics: 6364
Posts: 27828

 

Member Stats:
Guest Posters: 49
Members: 32346
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

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.