• 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
    • SALE 20% Off All Courses
    • 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
    • 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
    • Logout
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Excel LARGE and EOMONTH Array Function

You are here: Home / Excel Formulas / Excel LARGE and EOMONTH Array Function
Excel LARGE and EOMONTH Array Function
November 30, 2011 by Mynda Treacy

I’m working on a dashboard for a client and I’ve set it up so that they can choose which month they want to display in their report.

When they choose a new month the header in the report automatically updates to show the new 'From' and 'To' dates.

Excel LARGE Array formula

New data is added daily, so at times the period of the report may only be a partial month.

So, how do I find the ‘To’ date for my dashboard header?

Essentially I want to find the largest date for the chosen month.

Let’s say the dates are in a column with a named range db_date, and we currently have data for 1st January through to 24th November 2011.

We know that the LARGE function can find the largest date in the whole range.

So

=LARGE(db_date,1)

would correctly find the date of 24th November.

But what if they chose October? They’d still end up with a ‘To’ date of 24th November when it should read 31st October.

What we need is a LARGE IF function that said; find the largest date that is >= the ‘From’ date and <= to the last day of the ‘From’ month.

Unfortunately there’s not one function, but we can create a formula with an array like this:

{=LARGE(IF(db_date>=D3,IF(db_date<=EOMONTH(D3,0),db_date,0),0),1)}

In D3 we have the first day of the chosen month.

Remember with array formulas you enter them by pressing CTRL+SHIFT+ENTER and shazam, Excel magically puts the curly brackets in for you.

In English our formula reads:

=LARGE(IF(the date in the db_date column is >=D3, and IF(the date in the db_date column is <= the last day of the month in cell D3), find the LARGEST date in the db_date column that meet this criteria)

The EOMONTH function returns the serial number of the last day of the month before or after a specified number of months.

So

=EOMONTH(D3,0)

gives you 30/11/2011 (where D3 contains the date 1/11/2011)

=EOMONTH(D3,1)

gives you 31/12/2011

And

=EOMONTH(D3,-1)

gives you 31/10/2011.

Notes on EOMONTH:

  1. It is not recommended that you enter your dates as text e.g.
    =EOMONTH(“1/11/2011”,1)

    Instead refer to a cell containing the date or use the DATE function:


  2. =EOMONTH(DATE(2011,11,1),1)
  3. Excel 2003 users will need to install the Analysis ToolPak add-in to use the EOMONTH function.
  • On the Tools menu, click Add-Ins.
  • In the Add-Ins available list, select the Analysis ToolPak box, and then click OK.

Bonus Use for EOMONTH Function:

=EOMONTH(NOW(),0)

Gives you the last day of the current month.

Use it at your will.

For more on the LARGE Function.

For more on Array Formulas.

Do you have a different way of tackling this? Let me know in the comments below. I'd love to hear your ideas.

And don't forget to sign up for the weekly Excel newsletter below and get great tips to your inbox each week.

Excel LARGE and EOMONTH Array Function

More Excel Formulas Posts

top excel functions for data analysts

Top Excel Functions for Data Analysts

Must know Excel Functions for Data Analysts and what functions you don’t have to waste time learning and why.
excel advanced formula environment

Excel Advanced Formula Environment

Excel Advanced Formula Environment is a long awaited, new improved way to write, name and store Excel formulas.
Pro Excel Formula Writing Tips

Pro Excel Formula Writing Tips

Must know Excel formula writing tips, tricks and tools to make you an Excel formula ninja, including a new formula editor.
excel shaping arrays

New Array Shaping Excel Functions

The Excel Shaping Array Functions makes it easier than ever to reshape arrays and ranges using these purpose built functions
excel nested if functions what not to do

Excel IF Formulas and What Not To Do

Excel IF formulas can get out of hand when you nest too many IFs. Not only do they become unwieldy they’re difficult for anyone to understand
excel image function

Excel IMAGE Function

The Excel IMAGE Function enables you to embed images in a cell using a formula. It supports BMP, JPG/JPEG, GIF, TIFF, PNG, ICO, and WEBP files

Excel VSTACK and HSTACK Functions

New Excel VSTACK and HSTACK functions makes combining arrays of cells easy and with some clever tricks we can extend their capabilities.
identify overlapping dates and times in excel

Identify overlapping dates and times in Excel

How to identify overlapping dates and times in Excel with a formula that checks a range of cells. Works with Dates and Times.
New Excel Text Functions

TEXTSPLIT, TEXTBEFORE and TEXTAFTER Functions

TEXTAFTER, TEXTBEFORE and TEXTSPLIT are exciting new Excel Text functions. They’re fairly self-explanatory, however TEXTSPLIT has some cool features.

Top 10 Intermediate Excel Functions

Take your Excel skills to the next level with this top 10 intermediate Excel functions. These are must know functions for all Excel users.




Category: Excel Formulas
Previous Post:Cool INDEX Function TrickCool INDEX Function Trick
Next Post:Excel VLOOKUP Multiple ValuesExcel VLOOKUP Multiple Values

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Current ye@r *

Leave this field empty

Sidebar

More results...

Course Sale

mynda treacy microsoft mvpHi, I'm Mynda Treacy and I run MOTH with my husband, Phil. Through our blog, webinars, YouTube channel and courses we hope we can help you learn Excel, Power Pivot and DAX, Power Query, Power BI, and Excel Dashboards.

Subscribe to Our Newsletter

Receive weekly tutorials on Excel, Power Query, Power Pivot, Power BI and More.

We respect your email privacy

Guides and Resources

  • Excel Keyboard Shortcuts
  • Excel Functions
  • Excel Formulas
  • Excel Custom Number Formatting
  • ALT Codes
  • Pivot Tables
  • VLOOKUP
  • VBA
  • Excel Userforms
  • Free Downloads

239 Excel Keyboard Shortcuts

Download Free PDF

Free Webinars

Excel Dashboards Webinar

Watch our free webinars and learn to create Interactive Dashboard Reports in Excel or Power BI

Click Here to Watch Now

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
trustpilot excellent rating
 

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.